org.apache.commons.collections.iterators
Class AbstractTestListIterator
AbstractTestIterator
org.apache.commons.collections.iterators.AbstractTestListIterator
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.
AbstractTestListIterator
public AbstractTestListIterator(String testName)
JUnit constructor.
testName
- the test class name
addSetValue
public Object addSetValue()
The value to be used in the add and set tests.
Default is null.
makeEmptyIterator
public Iterator makeEmptyIterator()
Implements the abstract superclass method to return the list iterator.
makeEmptyListIterator
public abstract ListIterator makeEmptyListIterator()
Implement this method to return a list iterator over an empty collection.
makeFullIterator
public Iterator makeFullIterator()
Implements the abstract superclass method to return the list iterator.
makeFullListIterator
public abstract ListIterator makeFullListIterator()
Implement this method to return a list iterator over a collection with elements.
supportsAdd
public boolean supportsAdd()
Whether or not we are testing an iterator that supports add().
Default is true.
- true if Iterator supports add
supportsSet
public boolean supportsSet()
Whether or not we are testing an iterator that supports set().
Default is true.
- true if Iterator supports set
testAdd
public void testAdd()
Test add behaviour.
testAddThenRemove
public void testAddThenRemove()
Test remove after add behaviour.
testAddThenSet
public void testAddThenSet()
testEmptyListIteratorIsIndeedEmpty
public void testEmptyListIteratorIsIndeedEmpty()
Test that the empty list iterator contract is correct.
testRemoveThenSet
public void testRemoveThenSet()
testSet
public void testSet()
Test set behaviour.
testWalkForwardAndBack
public void testWalkForwardAndBack()
Test navigation through the iterator.
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.