public abstract class AbstractTestListIterator extends AbstractTestIterator
This class provides a framework for testing an implementation of ListIterator. Concrete subclasses must provide the list iterator to be tested. They must also specify certain details of how the list iterator operates by overriding the supportsXxx() methods if necessary.
COLLECTIONS_MAJOR_VERSION
Constructor and Description |
---|
AbstractTestListIterator(java.lang.String testName)
JUnit constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
addSetValue()
The value to be used in the add and set tests.
|
java.util.Iterator |
makeEmptyIterator()
Implements the abstract superclass method to return the list iterator.
|
abstract java.util.ListIterator |
makeEmptyListIterator()
Implement this method to return a list iterator over an empty collection.
|
java.util.Iterator |
makeFullIterator()
Implements the abstract superclass method to return the list iterator.
|
abstract java.util.ListIterator |
makeFullListIterator()
Implement this method to return a list iterator over a collection with elements.
|
boolean |
supportsAdd()
Whether or not we are testing an iterator that supports add().
|
boolean |
supportsSet()
Whether or not we are testing an iterator that supports set().
|
void |
testAdd()
Test add behaviour.
|
void |
testAddThenRemove()
Test remove after add behaviour.
|
void |
testAddThenSet() |
void |
testEmptyListIteratorIsIndeedEmpty()
Test that the empty list iterator contract is correct.
|
void |
testRemoveThenSet() |
void |
testSet()
Test set behaviour.
|
void |
testWalkForwardAndBack()
Test navigation through the iterator.
|
makeObject, supportsEmptyIterator, supportsFullIterator, supportsRemove, testEmptyIterator, testFullIterator, testRemove, verify
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 AbstractTestListIterator(java.lang.String testName)
testName
- the test class namepublic abstract java.util.ListIterator makeEmptyListIterator()
public abstract java.util.ListIterator makeFullListIterator()
public java.util.Iterator makeEmptyIterator()
makeEmptyIterator
in class AbstractTestIterator
public java.util.Iterator makeFullIterator()
makeFullIterator
in class AbstractTestIterator
public boolean supportsAdd()
public boolean supportsSet()
public java.lang.Object addSetValue()
public void testEmptyListIteratorIsIndeedEmpty()
public void testWalkForwardAndBack()
public void testAdd()
public void testSet()
public void testRemoveThenSet()
public void testAddThenSet()
public void testAddThenRemove()
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.