org.apache.commons.collections.iterators
public abstract class AbstractTestIterator extends AbstractTestObject
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.
Since: Commons Collections 3.0
Constructor Summary | |
---|---|
AbstractTestIterator(String testName)
JUnit constructor.
|
Method Summary | |
---|---|
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 |
Parameters: testName the test class name
Returns: an empty iterator
Returns: a full iterator
Returns: a full iterator
Returns: true if Iterator can be empty
Returns: true if Iterator can be full
Returns: true if Iterator supports remove