public class AbstractTestMap.TestMapValues extends AbstractTestCollection
collection, confirmedCOLLECTIONS_MAJOR_VERSION| Constructor and Description |
|---|
AbstractTestMap.TestMapValues() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areEqualElementsDistinguishable()
Specifies whether equal elements in the collection are, in fact,
distinguishable with information not readily available.
|
java.lang.Object[] |
getFullElements()
Returns an array of objects that are contained in a collection
produced by
AbstractTestCollection.makeFullCollection(). |
java.lang.Object[] |
getOtherElements()
Returns an array of elements that are not contained in a
full collection.
|
boolean |
isAddSupported()
Returns true if the collections produced by
AbstractTestCollection.makeCollection() and AbstractTestCollection.makeFullCollection()
support the add and addAll
operations. |
boolean |
isNullSupported()
Returns true to indicate that the collection supports holding null.
|
boolean |
isRemoveSupported()
Returns true if the collections produced by
AbstractTestCollection.makeCollection() and AbstractTestCollection.makeFullCollection()
support the remove, removeAll,
retainAll, clear and
iterator().remove() methods. |
boolean |
isTestSerialization()
Is serialization testing supported.
|
java.util.Collection |
makeCollection()
Return a new, empty
Collection to be used for testing. |
java.util.Collection |
makeConfirmedCollection()
Returns a confirmed empty collection.
|
java.util.Collection |
makeConfirmedFullCollection()
Returns a confirmed full collection.
|
java.util.Collection |
makeFullCollection()
Returns a full collection to be used for testing.
|
void |
resetEmpty()
Resets the
AbstractTestCollection.collection and AbstractTestCollection.confirmed fields to empty
collections. |
void |
resetFull()
Resets the
AbstractTestCollection.collection and AbstractTestCollection.confirmed fields to full
collections. |
void |
verify()
Verifies that
AbstractTestCollection.collection and AbstractTestCollection.confirmed have
identical state. |
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, testUnsupportedRemovegetCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDiskclone, ignoredTests, makeSuite, toStringpublic java.lang.Object[] getFullElements()
AbstractTestCollectionAbstractTestCollection.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.
getFullElements in class AbstractTestCollectionpublic java.lang.Object[] getOtherElements()
AbstractTestCollectionAbstractTestCollection.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.getOtherElements in class AbstractTestCollectionpublic java.util.Collection makeCollection()
AbstractTestCollectionCollection to be used for testing.makeCollection in class AbstractTestCollectionpublic java.util.Collection makeFullCollection()
AbstractTestCollectionAbstractTestCollection.getFullElements(). The default implementation, in fact,
simply invokes addAll on an empty collection with
the results of AbstractTestCollection.getFullElements(). Override this default
if your collection doesn't support addAll.makeFullCollection in class AbstractTestCollectionpublic boolean isNullSupported()
AbstractTestCollectionisNullSupported in class AbstractTestCollectionpublic boolean isAddSupported()
AbstractTestCollectionAbstractTestCollection.makeCollection() and AbstractTestCollection.makeFullCollection()
support the add and addAll
operations.Default implementation returns true. Override if your collection class does not support add or addAll.
isAddSupported in class AbstractTestCollectionpublic boolean isRemoveSupported()
AbstractTestCollectionAbstractTestCollection.makeCollection() and AbstractTestCollection.makeFullCollection()
support the remove, removeAll,
retainAll, clear and
iterator().remove() methods.
Default implementation returns true. Override if your collection
class does not support removal operations.isRemoveSupported in class AbstractTestCollectionpublic boolean isTestSerialization()
AbstractTestObjectisTestSerialization in class AbstractTestObjectpublic boolean areEqualElementsDistinguishable()
AbstractTestCollectionIn 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.
areEqualElementsDistinguishable in class AbstractTestCollectionpublic java.util.Collection makeConfirmedCollection()
AbstractTestCollectionArrayList for lists or a
HashSet for sets.makeConfirmedCollection in class AbstractTestCollectionpublic java.util.Collection makeConfirmedFullCollection()
AbstractTestCollectionArrayList for lists or a
HashSet for sets. The returned collection
should contain the elements returned by AbstractTestCollection.getFullElements().makeConfirmedFullCollection in class AbstractTestCollectionpublic void resetFull()
AbstractTestCollectionAbstractTestCollection.collection and AbstractTestCollection.confirmed fields to full
collections. Invoke this method before performing a modification
test.resetFull in class AbstractTestCollectionpublic void resetEmpty()
AbstractTestCollectionAbstractTestCollection.collection and AbstractTestCollection.confirmed fields to empty
collections. Invoke this method before performing a modification
test.resetEmpty in class AbstractTestCollectionpublic void verify()
AbstractTestCollectionAbstractTestCollection.collection and AbstractTestCollection.confirmed have
identical state.verify in class AbstractTestCollectionCopyright © 2001-2015 Apache Software Foundation. All Rights Reserved.