org.apache.commons.collections.iterators
Class AbstractTestIterator
AbstractTestObject
org.apache.commons.collections.iterators.AbstractTestIterator
public abstract class AbstractTestIterator
extends AbstractTestObject
Abstract class for testing the Iterator interface.
This class provides a framework for testing an implementation of Iterator.
Concrete subclasses must provide the iterator to be tested.
They must also specify certain details of how the iterator operates by
overriding the supportsXxx() methods if necessary.
abstract Iterator | makeEmptyIterator() - Implement this method to return an iterator over an empty collection.
|
abstract Iterator | makeFullIterator() - Implement this method to return an iterator over a collection with elements.
|
Object | makeObject() - Implements the abstract superclass method to return the full iterator.
|
boolean | supportsEmptyIterator() - Whether or not we are testing an iterator that can be empty.
|
boolean | supportsFullIterator() - Whether or not we are testing an iterator that can contain elements.
|
boolean | supportsRemove() - Whether or not we are testing an iterator that supports remove().
|
void | testEmptyIterator() - Test the empty iterator.
|
void | testFullIterator() - Test normal iteration behaviour.
|
void | testRemove() - Test remove behaviour.
|
void | verify() - Allows subclasses to add complex cross verification
|
AbstractTestIterator
public AbstractTestIterator(String testName)
JUnit constructor.
testName
- the test class name
makeEmptyIterator
public abstract Iterator makeEmptyIterator()
Implement this method to return an iterator over an empty collection.
makeFullIterator
public abstract Iterator makeFullIterator()
Implement this method to return an iterator over a collection with elements.
makeObject
public Object makeObject()
Implements the abstract superclass method to return the full iterator.
supportsEmptyIterator
public boolean supportsEmptyIterator()
Whether or not we are testing an iterator that can be empty.
Default is true.
- true if Iterator can be empty
supportsFullIterator
public boolean supportsFullIterator()
Whether or not we are testing an iterator that can contain elements.
Default is true.
- true if Iterator can be full
supportsRemove
public boolean supportsRemove()
Whether or not we are testing an iterator that supports remove().
Default is true.
- true if Iterator supports remove
testEmptyIterator
public void testEmptyIterator()
Test the empty iterator.
testFullIterator
public void testFullIterator()
Test normal iteration behaviour.
testRemove
public void testRemove()
Test remove behaviour.
verify
public void verify()
Allows subclasses to add complex cross verification
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.