Class AbstractTestMapIterator
- 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.AbstractTestMapIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
,junit.framework.Test
- Direct Known Subclasses:
AbstractTestBidiMap.TestBidiMapIterator
,AbstractTestIterableMap.InnerTestMapIterator
,AbstractTestOrderedBidiMap.TestBidiOrderedMapIterator
,AbstractTestOrderedMapIterator
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.
- Since:
- Commons Collections 3.0
-
-
Field Summary
-
Fields inherited from class org.apache.commons.collections.AbstractTestObject
COLLECTIONS_MAJOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description AbstractTestMapIterator(java.lang.String testName)
JUnit constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]
addSetValues()
The values to be used in the add and set tests.abstract java.util.Map
getConfirmedMap()
Implement this method to return the confirmed map which contains the same data as the iterator.abstract java.util.Map
getMap()
Implement this method to return the map which contains the same data as the iterator.boolean
isGetStructuralModify()
Whether the get operation on the map structurally modifies the map, such as with LRUMap.java.util.Iterator
makeEmptyIterator()
Implements the abstract superclass method to return the list iterator.abstract org.apache.commons.collections.MapIterator
makeEmptyMapIterator()
Implement this method to return a map iterator over an empty map.java.util.Iterator
makeFullIterator()
Implements the abstract superclass method to return the list iterator.abstract org.apache.commons.collections.MapIterator
makeFullMapIterator()
Implement this method to return a map iterator over a map with elements.boolean
supportsSetValue()
Whether or not we are testing an iterator that supports setValue().void
testEmptyMapIterator()
Test that the empty list iterator contract is correct.void
testFullMapIterator()
Test that the full list iterator contract is correct.void
testMapIteratorRemoveGetKey()
void
testMapIteratorRemoveGetValue()
void
testMapIteratorSet()
void
testMapIteratorSetRemoveSet()
void
testRemove()
Test remove behaviour.-
Methods inherited from class org.apache.commons.collections.iterators.AbstractTestIterator
makeObject, supportsEmptyIterator, supportsFullIterator, supportsRemove, testEmptyIterator, testFullIterator, 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
-
makeEmptyMapIterator
public abstract org.apache.commons.collections.MapIterator makeEmptyMapIterator()
Implement this method to return a map iterator over an empty map.- Returns:
- an empty iterator
-
makeFullMapIterator
public abstract org.apache.commons.collections.MapIterator makeFullMapIterator()
Implement this method to return a map iterator over a map with elements.- Returns:
- a full iterator
-
getMap
public abstract java.util.Map getMap()
Implement this method to return the map which contains the same data as the iterator.- Returns:
- a full map which can be updated
-
getConfirmedMap
public abstract java.util.Map getConfirmedMap()
Implement this method to return the confirmed map which contains the same data as the iterator.- Returns:
- a full map which can be updated
-
makeEmptyIterator
public final 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 final java.util.Iterator makeFullIterator()
Implements the abstract superclass method to return the list iterator.- Specified by:
makeFullIterator
in classAbstractTestIterator
- Returns:
- a full iterator
-
supportsSetValue
public boolean supportsSetValue()
Whether or not we are testing an iterator that supports setValue(). Default is true.- Returns:
- true if Iterator supports set
-
isGetStructuralModify
public boolean isGetStructuralModify()
Whether the get operation on the map structurally modifies the map, such as with LRUMap. Default is false.- Returns:
- true if the get method structurally modifies the map
-
addSetValues
public java.lang.Object[] addSetValues()
The values to be used in the add and set tests. Default is two strings.
-
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.
-
testMapIteratorSet
public void testMapIteratorSet()
-
testRemove
public void testRemove()
Description copied from class:AbstractTestIterator
Test remove behaviour.- Overrides:
testRemove
in classAbstractTestIterator
-
testMapIteratorSetRemoveSet
public void testMapIteratorSetRemoveSet()
-
testMapIteratorRemoveGetKey
public void testMapIteratorRemoveGetKey()
-
testMapIteratorRemoveGetValue
public void testMapIteratorRemoveGetValue()
-
-