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:
Cloneable
,junit.framework.Test
- Direct Known Subclasses:
AbstractTestList.TestListIterator
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 -
Method Summary
Modifier and TypeMethodDescriptionThe value to be used in the add and set tests.Implements the abstract superclass method to return the list iterator.abstract ListIterator
Implement this method to return a list iterator over an empty collection.Implements the abstract superclass method to return the list iterator.abstract ListIterator
Implement this method to return a list iterator over a collection with elements.boolean
Whether or not we are testing an iterator that supports add().boolean
Whether or not we are testing an iterator that supports set().void
testAdd()
Test add behaviour.void
Test remove after add behaviour.void
void
Test that the empty list iterator contract is correct.void
void
testSet()
Test set behaviour.void
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
-
Constructor Details
-
AbstractTestListIterator
JUnit constructor.- Parameters:
testName
- the test class name
-
-
Method Details
-
makeEmptyListIterator
Implement this method to return a list iterator over an empty collection.- Returns:
- an empty iterator
-
makeFullListIterator
Implement this method to return a list iterator over a collection with elements.- Returns:
- a full iterator
-
makeEmptyIterator
Implements the abstract superclass method to return the list iterator.- Specified by:
makeEmptyIterator
in classAbstractTestIterator
- Returns:
- an empty 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
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.
-