Class AbstractTestMap.TestMapValues
- All Implemented Interfaces:
Cloneable,junit.framework.Test
- Enclosing class:
AbstractTestMap
-
Field Summary
Fields inherited from class org.apache.commons.collections.collection.AbstractTestCollection
collection, confirmedFields inherited from class org.apache.commons.collections.AbstractTestObject
COLLECTIONS_MAJOR_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanSpecifies whether equal elements in the collection are, in fact, distinguishable with information not readily available.Object[]Returns an array of objects that are contained in a collection produced byAbstractTestCollection.makeFullCollection().Object[]Returns an array of elements that are not contained in a full collection.booleanReturns true if the collections produced byAbstractTestCollection.makeCollection()andAbstractTestCollection.makeFullCollection()support theaddandaddAlloperations.booleanReturns true to indicate that the collection supports holding null.booleanReturns true if the collections produced byAbstractTestCollection.makeCollection()andAbstractTestCollection.makeFullCollection()support theremove,removeAll,retainAll,clearanditerator().remove()methods.booleanIs serialization testing supported.Return a new, emptyCollectionto be used for testing.Returns a confirmed empty collection.Returns a confirmed full collection.Returns a full collection to be used for testing.voidResets theAbstractTestCollection.collectionandAbstractTestCollection.confirmedfields to empty collections.voidResets theAbstractTestCollection.collectionandAbstractTestCollection.confirmedfields to full collections.voidverify()Verifies thatAbstractTestCollection.collectionandAbstractTestCollection.confirmedhave identical state.Methods inherited from class org.apache.commons.collections.collection.AbstractTestCollection
cloneMapEntry, getFullNonNullElements, getFullNonNullStringElements, getOtherNonNullElements, getOtherNonNullStringElements, isEqualsCheckable, isFailFastSupported, makeObject, testCollectionAdd, testCollectionAddAll, testCollectionClear, testCollectionContains, testCollectionContainsAll, testCollectionIsEmpty, testCollectionIterator, testCollectionIteratorFailFast, testCollectionIteratorRemove, testCollectionRemove, testCollectionRemoveAll, testCollectionRetainAll, testCollectionSize, testCollectionToArray, testCollectionToArray2, testCollectionToString, testSerializeDeserializeThenCompare, testUnsupportedAdd, testUnsupportedRemoveMethods inherited from class org.apache.commons.collections.AbstractTestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDiskMethods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredTests, makeSuite, toStringMethods 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
-
Constructor Details
-
TestMapValues
public TestMapValues()
-
-
Method Details
-
getFullElements
Description copied from class:AbstractTestCollectionReturns an array of objects that are contained in a collection produced byAbstractTestCollection.makeFullCollection(). Every element in the returned array must be an element in a full collection.The default implementation returns a heterogenous array of objects with some duplicates. null is added if allowed. Override if you require specific testing elements. Note that if you override
AbstractTestCollection.makeFullCollection(), you must override this method to reflect the contents of a full collection.- Overrides:
getFullElementsin classAbstractTestCollection
-
getOtherElements
Description copied from class:AbstractTestCollectionReturns an array of elements that are not contained in a full collection. Every element in the returned array must not exist in a collection returned byAbstractTestCollection.makeFullCollection(). The default implementation returns a heterogenous array of elements without null. Note that some of the tests add these elements to an empty or full collection, so if your collection restricts certain kinds of elements, you should override this method.- Overrides:
getOtherElementsin classAbstractTestCollection
-
makeCollection
Description copied from class:AbstractTestCollectionReturn a new, emptyCollectionto be used for testing.- Specified by:
makeCollectionin classAbstractTestCollection
-
makeFullCollection
Description copied from class:AbstractTestCollectionReturns a full collection to be used for testing. The collection returned by this method should contain every element returned byAbstractTestCollection.getFullElements(). The default implementation, in fact, simply invokesaddAllon an empty collection with the results ofAbstractTestCollection.getFullElements(). Override this default if your collection doesn't support addAll.- Overrides:
makeFullCollectionin classAbstractTestCollection
-
isNullSupported
public boolean isNullSupported()Description copied from class:AbstractTestCollectionReturns true to indicate that the collection supports holding null. The default implementation returns true;- Overrides:
isNullSupportedin classAbstractTestCollection
-
isAddSupported
public boolean isAddSupported()Description copied from class:AbstractTestCollectionReturns true if the collections produced byAbstractTestCollection.makeCollection()andAbstractTestCollection.makeFullCollection()support theaddandaddAlloperations.Default implementation returns true. Override if your collection class does not support add or addAll.
- Overrides:
isAddSupportedin classAbstractTestCollection
-
isRemoveSupported
public boolean isRemoveSupported()Description copied from class:AbstractTestCollectionReturns true if the collections produced byAbstractTestCollection.makeCollection()andAbstractTestCollection.makeFullCollection()support theremove,removeAll,retainAll,clearanditerator().remove()methods. Default implementation returns true. Override if your collection class does not support removal operations.- Overrides:
isRemoveSupportedin classAbstractTestCollection
-
isTestSerialization
public boolean isTestSerialization()Description copied from class:AbstractTestObjectIs serialization testing supported. Default is true.- Overrides:
isTestSerializationin classAbstractTestObject
-
areEqualElementsDistinguishable
public boolean areEqualElementsDistinguishable()Description copied from class:AbstractTestCollectionSpecifies whether equal elements in the collection are, in fact, distinguishable with information not readily available. That is, if a particular value is to be removed from the collection, then there is one and only one value that can be removed, even if there are other elements which are equal to it.In most collection cases, elements are not distinguishable (equal is equal), thus this method defaults to return false. In some cases, however, they are. For example, the collection returned from the map's values() collection view are backed by the map, so while there may be two values that are equal, their associated keys are not. Since the keys are distinguishable, the values are.
This flag is used to skip some verifications for iterator.remove() where it is impossible to perform an equivalent modification on the confirmed collection because it is not possible to determine which value in the confirmed collection to actually remove. Tests that override the default (i.e. where equal elements are distinguishable), should provide additional tests on iterator.remove() to make sure the proper elements are removed when remove() is called on the iterator.
- Overrides:
areEqualElementsDistinguishablein classAbstractTestCollection
-
makeConfirmedCollection
Description copied from class:AbstractTestCollection- Specified by:
makeConfirmedCollectionin classAbstractTestCollection- Returns:
- a confirmed empty collection
-
makeConfirmedFullCollection
Description copied from class:AbstractTestCollectionReturns a confirmed full collection. For instance, anArrayListfor lists or aHashSetfor sets. The returned collection should contain the elements returned byAbstractTestCollection.getFullElements().- Specified by:
makeConfirmedFullCollectionin classAbstractTestCollection- Returns:
- a confirmed full collection
-
resetFull
public void resetFull()Description copied from class:AbstractTestCollectionResets theAbstractTestCollection.collectionandAbstractTestCollection.confirmedfields to full collections. Invoke this method before performing a modification test.- Overrides:
resetFullin classAbstractTestCollection
-
resetEmpty
public void resetEmpty()Description copied from class:AbstractTestCollectionResets theAbstractTestCollection.collectionandAbstractTestCollection.confirmedfields to empty collections. Invoke this method before performing a modification test.- Overrides:
resetEmptyin classAbstractTestCollection
-
verify
public void verify()Description copied from class:AbstractTestCollectionVerifies thatAbstractTestCollection.collectionandAbstractTestCollection.confirmedhave identical state.- Overrides:
verifyin classAbstractTestCollection
-