org.apache.commons.collections.iterators
Class AbstractTestMapIterator
AbstractTestIterator
org.apache.commons.collections.iterators.AbstractTestMapIterator
public abstract class AbstractTestMapIterator
extends AbstractTestIterator
Abstract class for testing the MapIterator interface.
This class provides a framework for testing an implementation of MapIterator.
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.
AbstractTestMapIterator
public AbstractTestMapIterator(String testName)
JUnit constructor.
testName
- the test class name
addSetValues
public Object[] addSetValues()
The values to be used in the add and set tests.
Default is two strings.
getConfirmedMap
public abstract Map getConfirmedMap()
Implement this method to return the confirmed map which contains the same
data as the iterator.
- a full map which can be updated
getMap
public abstract Map getMap()
Implement this method to return the map which contains the same data as the
iterator.
- a full map which can be updated
isGetStructuralModify
public boolean isGetStructuralModify()
Whether the get operation on the map structurally modifies the map,
such as with LRUMap. Default is false.
- true if the get method structurally modifies the map
makeEmptyIterator
public final Iterator makeEmptyIterator()
Implements the abstract superclass method to return the list iterator.
makeEmptyMapIterator
public abstract MapIterator makeEmptyMapIterator()
Implement this method to return a map iterator over an empty map.
makeFullIterator
public final Iterator makeFullIterator()
Implements the abstract superclass method to return the list iterator.
makeFullMapIterator
public abstract MapIterator makeFullMapIterator()
Implement this method to return a map iterator over a map with elements.
supportsSetValue
public boolean supportsSetValue()
Whether or not we are testing an iterator that supports setValue().
Default is true.
- true if Iterator supports set
testEmptyMapIterator
public void testEmptyMapIterator()
Test that the empty list iterator contract is correct.
testFullMapIterator
public void testFullMapIterator()
Test that the full list iterator contract is correct.
testMapIteratorRemoveGetKey
public void testMapIteratorRemoveGetKey()
testMapIteratorRemoveGetValue
public void testMapIteratorRemoveGetValue()
testMapIteratorSet
public void testMapIteratorSet()
testMapIteratorSetRemoveSet
public void testMapIteratorSetRemoveSet()
testRemove
public void testRemove()
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.