Class AbstractTestListIterator
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.commons.collections.BulkTest
-
- org.apache.commons.collections.AbstractTestObject
-
- org.apache.commons.collections.iterators.AbstractTestIterator
-
- org.apache.commons.collections.iterators.AbstractTestListIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
,junit.framework.Test
- Direct Known Subclasses:
AbstractTestList.TestListIterator
public abstract class AbstractTestListIterator extends AbstractTestIterator
Abstract class for testing the ListIterator interface.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.
- Since:
- Commons Collections 3.0
-
-
Field Summary
-
Fields inherited from class org.apache.commons.collections.AbstractTestObject
COLLECTIONS_MAJOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description AbstractTestListIterator(java.lang.String testName)
JUnit constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class org.apache.commons.collections.iterators.AbstractTestIterator
makeObject, supportsEmptyIterator, supportsFullIterator, supportsRemove, testEmptyIterator, testFullIterator, testRemove, verify
-
Methods inherited from class org.apache.commons.collections.AbstractTestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, isEqualsCheckable, isTestSerialization, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSerializeDeserializeThenCompare, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
-
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredTests, makeSuite, toString
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown
-
-
-
-
Method Detail
-
makeEmptyListIterator
public abstract java.util.ListIterator makeEmptyListIterator()
Implement this method to return a list iterator over an empty collection.- Returns:
- an empty iterator
-
makeFullListIterator
public abstract java.util.ListIterator makeFullListIterator()
Implement this method to return a list iterator over a collection with elements.- Returns:
- a full iterator
-
makeEmptyIterator
public java.util.Iterator makeEmptyIterator()
Implements the abstract superclass method to return the list iterator.- Specified by:
makeEmptyIterator
in classAbstractTestIterator
- Returns:
- an empty iterator
-
makeFullIterator
public java.util.Iterator makeFullIterator()
Implements the abstract superclass method to return the list iterator.- Specified by:
makeFullIterator
in classAbstractTestIterator
- Returns:
- a full iterator
-
supportsAdd
public boolean supportsAdd()
Whether or not we are testing an iterator that supports add(). Default is true.- Returns:
- true if Iterator supports add
-
supportsSet
public boolean supportsSet()
Whether or not we are testing an iterator that supports set(). Default is true.- Returns:
- true if Iterator supports set
-
addSetValue
public java.lang.Object addSetValue()
The value to be used in the add and set tests. Default is null.
-
testEmptyListIteratorIsIndeedEmpty
public void testEmptyListIteratorIsIndeedEmpty()
Test that the empty list iterator contract is correct.
-
testWalkForwardAndBack
public void testWalkForwardAndBack()
Test navigation through the iterator.
-
testAdd
public void testAdd()
Test add behaviour.
-
testSet
public void testSet()
Test set behaviour.
-
testRemoveThenSet
public void testRemoveThenSet()
-
testAddThenSet
public void testAddThenSet()
-
testAddThenRemove
public void testAddThenRemove()
Test remove after add behaviour.
-
-