Class AbstractTestSortedMap.TestViewMap
- 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.map.AbstractTestSortedMap
-
- org.apache.commons.collections.map.AbstractTestSortedMap.TestViewMap
-
- All Implemented Interfaces:
java.lang.Cloneable
,junit.framework.Test
- Direct Known Subclasses:
AbstractTestSortedMap.TestHeadMap
,AbstractTestSortedMap.TestSubMap
,AbstractTestSortedMap.TestTailMap
- Enclosing class:
- AbstractTestSortedMap
public abstract static class AbstractTestSortedMap.TestViewMap extends AbstractTestSortedMap
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractTestSortedMap
AbstractTestSortedMap.TestHeadMap, AbstractTestSortedMap.TestSubMap, AbstractTestSortedMap.TestTailMap, AbstractTestSortedMap.TestViewMap
-
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 AbstractTestMap
main
protected java.util.List
subSortedKeys
protected java.util.List
subSortedNewValues
protected java.util.List
subSortedValues
-
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 TestViewMap(java.lang.String name, AbstractTestMap main)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkTest
bulkTestHeadMap()
BulkTest
bulkTestSubMap()
BulkTest
bulkTestTailMap()
java.lang.Object[]
getNewSampleValues()
Returns a the set of values that can be used to replace the values returned fromAbstractTestMap.getSampleValues()
.java.lang.Object[]
getSampleKeys()
Returns the set of keys in the mappings used to test the map.java.lang.Object[]
getSampleValues()
Returns the set of values in the mappings used to test the map.boolean
isAllowNullKey()
Can't sort null keys.boolean
isAllowNullValue()
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
supports null values.boolean
isPutAddSupported()
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theput
andputAll
operations adding new mappings.boolean
isPutChangeSupported()
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theput
andputAll
operations changing existing mappings.boolean
isRemoveSupported()
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theremove
andclear
operations.boolean
isTestSerialization()
Is serialization testing supported.void
resetEmpty()
Resets theAbstractTestMap.map
,AbstractTestMap.entrySet
,AbstractTestMap.keySet
,AbstractTestMap.values
andAbstractTestMap.confirmed
fields to empty.void
resetFull()
Resets theAbstractTestMap.map
,AbstractTestMap.entrySet
,AbstractTestMap.keySet
,AbstractTestMap.values
andAbstractTestMap.confirmed
fields to full.void
verify()
Verifies thatAbstractTestMap.map
is still equal toAbstractTestMap.confirmed
.-
Methods inherited from class org.apache.commons.collections.map.AbstractTestSortedMap
makeConfirmedMap, testComparator, testFirstKey, testLastKey
-
Methods inherited from class org.apache.commons.collections.map.AbstractTestMap
addSampleMappings, bulkTestMapEntrySet, bulkTestMapKeySet, bulkTestMapValues, cloneMapEntry, getCompatibilityVersion, getOtherKeys, getOtherNonNullStringElements, getOtherValues, isAllowDuplicateValues, isGetStructuralModify, isSetValueSupported, isSubMapViewsSerializable, makeEmptyMap, makeFullMap, makeObject, 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, 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
-
-
-
-
Field Detail
-
main
protected final AbstractTestMap main
-
subSortedKeys
protected final java.util.List subSortedKeys
-
subSortedValues
protected final java.util.List subSortedValues
-
subSortedNewValues
protected final java.util.List subSortedNewValues
-
-
Constructor Detail
-
TestViewMap
public TestViewMap(java.lang.String name, AbstractTestMap main)
-
-
Method Detail
-
resetEmpty
public void resetEmpty()
Description copied from class:AbstractTestMap
Resets theAbstractTestMap.map
,AbstractTestMap.entrySet
,AbstractTestMap.keySet
,AbstractTestMap.values
andAbstractTestMap.confirmed
fields to empty.- Overrides:
resetEmpty
in classAbstractTestMap
-
resetFull
public void resetFull()
Description copied from class:AbstractTestMap
Resets theAbstractTestMap.map
,AbstractTestMap.entrySet
,AbstractTestMap.keySet
,AbstractTestMap.values
andAbstractTestMap.confirmed
fields to full.- Overrides:
resetFull
in classAbstractTestMap
-
verify
public void verify()
Description copied from class:AbstractTestMap
Verifies thatAbstractTestMap.map
is still equal toAbstractTestMap.confirmed
. This method checks that the map is equal to the HashMap, and that the map's collection views are still equal to the HashMap's collection views. Anequals
test is done on the maps and their collection views; their size andisEmpty
results are compared; their hashCodes are compared; andcontainsAll
tests are run on the collection views.- Overrides:
verify
in classAbstractTestMap
-
bulkTestHeadMap
public BulkTest bulkTestHeadMap()
- Overrides:
bulkTestHeadMap
in classAbstractTestSortedMap
-
bulkTestTailMap
public BulkTest bulkTestTailMap()
- Overrides:
bulkTestTailMap
in classAbstractTestSortedMap
-
bulkTestSubMap
public BulkTest bulkTestSubMap()
- Overrides:
bulkTestSubMap
in classAbstractTestSortedMap
-
getSampleKeys
public java.lang.Object[] getSampleKeys()
Description copied from class:AbstractTestMap
Returns the set of keys in the mappings used to test the map. This method must return an array with the same length asAbstractTestMap.getSampleValues()
and all array elements must be different. The default implementation constructs a set of String keys, and includes a single null key ifAbstractTestMap.isAllowNullKey()
returnstrue
.- Overrides:
getSampleKeys
in classAbstractTestMap
-
getSampleValues
public java.lang.Object[] getSampleValues()
Description copied from class:AbstractTestMap
Returns the set of values in the mappings used to test the map. This method must return an array with the same length asAbstractTestMap.getSampleKeys()
. The default implementation constructs a set of String values and includes a single null value ifAbstractTestMap.isAllowNullValue()
returnstrue
, and includes two values that are the same ifAbstractTestMap.isAllowDuplicateValues()
returnstrue
.- Overrides:
getSampleValues
in classAbstractTestMap
-
getNewSampleValues
public java.lang.Object[] getNewSampleValues()
Description copied from class:AbstractTestMap
Returns a the set of values that can be used to replace the values returned fromAbstractTestMap.getSampleValues()
. This method must return an array with the same length asAbstractTestMap.getSampleValues()
. The values returned from this method should not be the same as those returned fromAbstractTestMap.getSampleValues()
. The default implementation constructs a set of String values and includes a single null value ifAbstractTestMap.isAllowNullValue()
returnstrue
, and includes two values that are the same ifAbstractTestMap.isAllowDuplicateValues()
returnstrue
.- Overrides:
getNewSampleValues
in classAbstractTestMap
-
isAllowNullKey
public boolean isAllowNullKey()
Description copied from class:AbstractTestSortedMap
Can't sort null keys.- Overrides:
isAllowNullKey
in classAbstractTestSortedMap
- Returns:
- false
-
isAllowNullValue
public boolean isAllowNullValue()
Description copied from class:AbstractTestMap
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
supports null values.Default implementation returns true. Override if your collection class does not support null values.
- Overrides:
isAllowNullValue
in classAbstractTestMap
-
isPutAddSupported
public boolean isPutAddSupported()
Description copied from class:AbstractTestMap
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theput
andputAll
operations adding new mappings.Default implementation returns true. Override if your collection class does not support put adding.
- Overrides:
isPutAddSupported
in classAbstractTestMap
-
isPutChangeSupported
public boolean isPutChangeSupported()
Description copied from class:AbstractTestMap
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theput
andputAll
operations changing existing mappings.Default implementation returns true. Override if your collection class does not support put changing.
- Overrides:
isPutChangeSupported
in classAbstractTestMap
-
isRemoveSupported
public boolean isRemoveSupported()
Description copied from class:AbstractTestMap
Returns true if the maps produced byAbstractTestMap.makeEmptyMap()
andAbstractTestMap.makeFullMap()
support theremove
andclear
operations.Default implementation returns true. Override if your collection class does not support removal operations.
- Overrides:
isRemoveSupported
in classAbstractTestMap
-
isTestSerialization
public boolean isTestSerialization()
Description copied from class:AbstractTestObject
Is serialization testing supported. Default is true.- Overrides:
isTestSerialization
in classAbstractTestObject
-
-