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.
COLLECTIONS_MAJOR_VERSION
Constructor and Description |
---|
AbstractTestIterator(java.lang.String testName)
JUnit constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract java.util.Iterator |
makeEmptyIterator()
Implement this method to return an iterator over an empty collection.
|
abstract java.util.Iterator |
makeFullIterator()
Implement this method to return an iterator over a collection with elements.
|
java.lang.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
|
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, isEqualsCheckable, isTestSerialization, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSerializeDeserializeThenCompare, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
clone, ignoredTests, makeSuite, toString
public AbstractTestIterator(java.lang.String testName)
testName
- the test class namepublic abstract java.util.Iterator makeEmptyIterator()
public abstract java.util.Iterator makeFullIterator()
public java.lang.Object makeObject()
makeObject
in class AbstractTestObject
public boolean supportsEmptyIterator()
public boolean supportsFullIterator()
public boolean supportsRemove()
public void verify()
public void testEmptyIterator()
public void testFullIterator()
public void testRemove()
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.