Keel 2.1RC2

org.apache.commons.collections
Class TestMap.TestMapValues

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.commons.collections.BulkTest
              extended byorg.apache.commons.collections.TestObject
                  extended byorg.apache.commons.collections.TestCollection
                      extended byorg.apache.commons.collections.TestMap.TestMapValues
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Enclosing class:
TestMap

class TestMap.TestMapValues
extends TestCollection


Field Summary
 
Fields inherited from class org.apache.commons.collections.TestCollection
collection, confirmed
 
Fields inherited from class org.apache.commons.collections.TestObject
COLLECTIONS_MAJOR_VERSION
 
Fields inherited from class org.apache.commons.collections.BulkTest
verboseName
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestMap.TestMapValues()
           
 
Method Summary
protected  boolean areEqualElementsDistinguishable()
          Specifies whether equal elements in the collection are, in fact, distinguishable with information not readily available.
protected  java.lang.Object[] getFullElements()
          Returns an array of objects that are contained in a collection produced by makeFullCollection().
protected  java.lang.Object[] getOtherElements()
          Returns an array of elements that are not contained in a full collection.
protected  boolean isAddSupported()
          Returns true if the collections produced by makeCollection() and makeFullCollection() support the add and addAll operations.
protected  boolean isRemoveSupported()
          Returns true if the collections produced by makeCollection() and makeFullCollection() support the remove, removeAll, retainAll, clear and iterator().remove() methods.
protected  java.util.Collection makeCollection()
          Return a new, empty Collection to be used for testing.
protected  java.util.Collection makeConfirmedCollection()
          Returns a confirmed empty collection.
protected  java.util.Collection makeConfirmedFullCollection()
          Returns a confirmed full collection.
protected  java.util.Collection makeFullCollection()
          Returns a full collection to be used for testing.
protected  void resetEmpty()
          Resets the TestCollection.collection and TestMap.confirmed fields to empty collections.
protected  void resetFull()
          Resets the TestCollection.collection and TestMap.confirmed fields to full collections.
protected  void verify()
          Verifies that TestCollection.collection and TestMap.confirmed have identical state.
 
Methods inherited from class org.apache.commons.collections.TestCollection
getFullNonNullElements, getFullNonNullStringElements, getOtherNonNullElements, getOtherNonNullStringElements, makeObject, testCollectionAdd, testCollectionAddAll, testCollectionClear, testCollectionContains, testCollectionContainsAll, testCollectionIsEmpty, testCollectionIterator, testCollectionIteratorFailFast, testCollectionIteratorRemove, testCollectionRemove, testCollectionRemoveAll, testCollectionRetainAll, testCollectionSize, testCollectionToArray, testCollectionToArray2, testCollectionToString, testUnsupportedAdd, testUnsupportedRemove
 
Methods inherited from class org.apache.commons.collections.TestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, readExternalFormFromBytes, readExternalFormFromDisk, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
 
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredSimpleTests, makeSuite, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestMap.TestMapValues

public TestMap.TestMapValues()
Method Detail

getFullElements

protected java.lang.Object[] getFullElements()
Description copied from class: TestCollection
Returns an array of objects that are contained in a collection produced by TestCollection.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 and with the null element. Override if you require specific testing elements. Note that if you override TestCollection.makeFullCollection(), you must override this method to reflect the contents of a full collection.

Overrides:
getFullElements in class TestCollection

getOtherElements

protected java.lang.Object[] getOtherElements()
Description copied from class: TestCollection
Returns 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 by TestCollection.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:
getOtherElements in class TestCollection

makeCollection

protected java.util.Collection makeCollection()
Description copied from class: TestCollection
Return a new, empty Collection to be used for testing.

Specified by:
makeCollection in class TestCollection

makeFullCollection

protected java.util.Collection makeFullCollection()
Description copied from class: TestCollection
Returns a full collection to be used for testing. The collection returned by this method should contain every element returned by TestCollection.getFullElements(). The default implementation, in fact, simply invokes addAll on an empty collection with the results of TestCollection.getFullElements(). Override this default if your collection doesn't support addAll.

Overrides:
makeFullCollection in class TestCollection

isAddSupported

protected boolean isAddSupported()
Description copied from class: TestCollection
Returns true if the collections produced by TestCollection.makeCollection() and TestCollection.makeFullCollection() support the add and addAll operations.

Default implementation returns true. Override if your collection class does not support add or addAll.

Overrides:
isAddSupported in class TestCollection

isRemoveSupported

protected boolean isRemoveSupported()
Description copied from class: TestCollection
Returns true if the collections produced by TestCollection.makeCollection() and TestCollection.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.

Overrides:
isRemoveSupported in class TestCollection

areEqualElementsDistinguishable

protected boolean areEqualElementsDistinguishable()
Description copied from class: TestCollection
Specifies 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:
areEqualElementsDistinguishable in class TestCollection

makeConfirmedCollection

protected java.util.Collection makeConfirmedCollection()
Description copied from class: TestCollection
Returns a confirmed empty collection. For instance, an ArrayList for lists or a HashSet for sets.

Specified by:
makeConfirmedCollection in class TestCollection
Returns:
a confirmed empty collection

makeConfirmedFullCollection

protected java.util.Collection makeConfirmedFullCollection()
Description copied from class: TestCollection
Returns a confirmed full collection. For instance, an ArrayList for lists or a HashSet for sets. The returned collection should contain the elements returned by TestCollection.getFullElements().

Specified by:
makeConfirmedFullCollection in class TestCollection
Returns:
a confirmed full collection

resetFull

protected void resetFull()
Description copied from class: TestCollection
Resets the TestCollection.collection and TestCollection.confirmed fields to full collections. Invoke this method before performing a modification test.

Overrides:
resetFull in class TestCollection

resetEmpty

protected void resetEmpty()
Description copied from class: TestCollection
Resets the TestCollection.collection and TestCollection.confirmed fields to empty collections. Invoke this method before performing a modification test.

Overrides:
resetEmpty in class TestCollection

verify

protected void verify()
Description copied from class: TestCollection
Verifies that TestCollection.collection and TestCollection.confirmed have identical state.

Overrides:
verify in class TestCollection

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.