Class AbstractTestBidiMap
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.commons.collections.BulkTest
-
- org.apache.commons.collections.AbstractTestObject
-
- org.apache.commons.collections.map.AbstractTestMap
-
- org.apache.commons.collections.bidimap.AbstractTestBidiMap
-
- All Implemented Interfaces:
java.lang.Cloneable
,junit.framework.Test
- Direct Known Subclasses:
AbstractTestBidiMap.TestInverseBidiMap
,AbstractTestOrderedBidiMap
public abstract class AbstractTestBidiMap extends AbstractTestMap
Abstract test class forBidiMap
methods and contracts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractTestBidiMap.TestBidiMapEntrySet
class
AbstractTestBidiMap.TestBidiMapIterator
class
AbstractTestBidiMap.TestInverseBidiMap
-
Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractTestMap
AbstractTestMap.TestMapEntrySet, AbstractTestMap.TestMapKeySet, AbstractTestMap.TestMapValues
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[][]
entries
-
Fields inherited from class org.apache.commons.collections.map.AbstractTestMap
confirmed, entrySet, keySet, map, values
-
Fields inherited from class org.apache.commons.collections.AbstractTestObject
COLLECTIONS_MAJOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description AbstractTestBidiMap()
AbstractTestBidiMap(java.lang.String testName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BulkTest
bulkTestBidiMapIterator()
BulkTest
bulkTestInverseMap()
BulkTest
bulkTestMapEntrySet()
Bulk testMap.entrySet()
.java.lang.String
getCompatibilityVersion()
Override as DualHashBidiMap didn't exist until version 3.boolean
isAllowDuplicateValues()
Override to indicate to AbstractTestMap this is a BidiMap.abstract org.apache.commons.collections.BidiMap
makeEmptyBidiMap()
Implement to create an emptyBidiMap
.java.util.Map
makeEmptyMap()
Override to return the empty BidiMap.org.apache.commons.collections.BidiMap
makeFullBidiMap()
Override to create a fullBidiMap
other than the default.void
testBidiClear()
void
testBidiGetKey()
void
testBidiGetKeyInverse()
void
testBidiInverse()
void
testBidiKeySetValuesOrder()
void
testBidiMapIteratorSet()
void
testBidiModifyEntrySet()
void
testBidiPut()
void
testBidiRemove()
void
testBidiRemoveByEntrySet()
void
testBidiRemoveByKeySet()
void
verify()
Verifies thatAbstractTestMap.map
is still equal toAbstractTestMap.confirmed
.void
verifyInverse()
-
Methods inherited from class org.apache.commons.collections.map.AbstractTestMap
addSampleMappings, bulkTestMapKeySet, bulkTestMapValues, cloneMapEntry, getNewSampleValues, getOtherKeys, getOtherNonNullStringElements, getOtherValues, getSampleKeys, getSampleValues, isAllowNullKey, isAllowNullValue, isGetStructuralModify, isPutAddSupported, isPutChangeSupported, isRemoveSupported, isSetValueSupported, isSubMapViewsSerializable, makeConfirmedMap, makeFullMap, makeObject, resetEmpty, resetFull, tearDown, testEmptyMapCompatibility, testEntrySetClearChangesMap, testEntrySetContains1, testEntrySetContains2, testEntrySetContains3, testEntrySetRemove1, testEntrySetRemove2, testEntrySetRemove3, testFullMapCompatibility, testKeySetClearChangesMap, testKeySetRemoveChangesMap, testMakeMap, testMapClear, testMapContainsKey, testMapContainsValue, testMapEquals, testMapGet, testMapHashCode, testMapIsEmpty, testMapPut, testMapPutAll, testMapPutNullKey, testMapPutNullValue, testMapRemove, testMapSize, testMapToString, testSampleMappings, testValuesClearChangesMap, testValuesRemoveChangesMap, verifyEntrySet, verifyKeySet, verifyMap, verifyValues
-
Methods inherited from class org.apache.commons.collections.AbstractTestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, 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
-
-
-
-
Method Detail
-
makeEmptyBidiMap
public abstract org.apache.commons.collections.BidiMap makeEmptyBidiMap()
Implement to create an emptyBidiMap
.- Returns:
- an empty
BidiMap
implementation.
-
makeFullBidiMap
public org.apache.commons.collections.BidiMap makeFullBidiMap()
Override to create a fullBidiMap
other than the default.- Returns:
- a full
BidiMap
implementation.
-
makeEmptyMap
public final java.util.Map makeEmptyMap()
Override to return the empty BidiMap.- Specified by:
makeEmptyMap
in classAbstractTestMap
- Returns:
- the map to be tested
-
isAllowDuplicateValues
public boolean isAllowDuplicateValues()
Override to indicate to AbstractTestMap this is a BidiMap.- Overrides:
isAllowDuplicateValues
in classAbstractTestMap
-
getCompatibilityVersion
public java.lang.String getCompatibilityVersion()
Override as DualHashBidiMap didn't exist until version 3.- Overrides:
getCompatibilityVersion
in classAbstractTestMap
- Returns:
- The version, or
null
if this object shouldn't be tested for compatibility with previous versions.
-
testBidiPut
public void testBidiPut()
-
verify
public void verify()
Verifies thatAbstractTestMap.map
is still equal toAbstractTestMap.confirmed
.This implementation checks the inverse map as well.
- Overrides:
verify
in classAbstractTestMap
-
verifyInverse
public void verifyInverse()
-
testBidiGetKey
public void testBidiGetKey()
-
testBidiGetKeyInverse
public void testBidiGetKeyInverse()
-
testBidiInverse
public void testBidiInverse()
-
testBidiModifyEntrySet
public void testBidiModifyEntrySet()
-
testBidiClear
public void testBidiClear()
-
testBidiRemove
public void testBidiRemove()
-
testBidiKeySetValuesOrder
public void testBidiKeySetValuesOrder()
-
testBidiRemoveByKeySet
public void testBidiRemoveByKeySet()
-
testBidiRemoveByEntrySet
public void testBidiRemoveByEntrySet()
-
bulkTestMapEntrySet
public BulkTest bulkTestMapEntrySet()
Description copied from class:AbstractTestMap
Bulk testMap.entrySet()
. This method runs through all of the tests inAbstractTestSet
. After modification operations,AbstractTestMap.verify()
is invoked to ensure that the map and the other collection views are still valid.- Overrides:
bulkTestMapEntrySet
in classAbstractTestMap
- Returns:
- a
AbstractTestSet
instance for testing the map's entry set
-
bulkTestInverseMap
public BulkTest bulkTestInverseMap()
-
bulkTestBidiMapIterator
public BulkTest bulkTestBidiMapIterator()
-
testBidiMapIteratorSet
public void testBidiMapIteratorSet()
-
-