Save This Page
Home » commons-collections-3.2.1-src » org.apache.commons » collections » set » [javadoc | source]
org.apache.commons.collections.set
abstract public class: AbstractTestSet [javadoc | source]
java.lang.Object
   junit.framework.TestCase
      org.apache.commons.collections.BulkTest
         org.apache.commons.collections.AbstractTestObject
            org.apache.commons.collections.collection.AbstractTestCollection
               org.apache.commons.collections.set.AbstractTestSet

All Implemented Interfaces:
    Cloneable

Direct Known Subclasses:
    TestSynchronizedSet, TestPredicatedSortedSet, TestSortedSetSubSet, TestUnmodifiableSet, TestCompositeSet, TestListOrderedSet, TestMapBackedSet, TestUnmodifiableSortedSet, TestTransformedSet, TestTypedSortedSet, TestSynchronizedSortedSet, TestTypedSet, TestMapEntrySet, AbstractTestSortedSet, TestListOrderedSet2, TestPredicatedSet, TestTransformedSortedSet, TestMapBackedSet2, TestMapKeySet

Abstract test class for Set methods and contracts.

Since Set doesn't stipulate much new behavior that isn't already found in Collection , this class basically just adds tests for Set#equals and Set#hashCode() along with an updated #verify() that ensures elements do not appear more than once in the set.

To use, subclass and override the #makeEmptySet() method. You may have to override other protected methods if your set is not modifiable, or if your set restricts what kinds of elements may be added; see AbstractTestCollection for more details.

Fields inherited from org.apache.commons.collections.collection.AbstractTestCollection:
collection,  confirmed
Fields inherited from org.apache.commons.collections.AbstractTestObject:
COLLECTIONS_MAJOR_VERSION
Fields inherited from org.apache.commons.collections.BulkTest:
verboseName
Constructor:
 public AbstractTestSet(String name) 
    JUnit constructor.
    Parameters:
    name - name for test
Method from org.apache.commons.collections.set.AbstractTestSet Summary:
getConfirmedSet,   getSet,   isEqualsCheckable,   makeCollection,   makeConfirmedCollection,   makeConfirmedFullCollection,   makeEmptySet,   makeFullCollection,   makeFullSet,   testSetEquals,   testSetHashCode,   verify
Methods from org.apache.commons.collections.collection.AbstractTestCollection:
areEqualElementsDistinguishable,   cloneMapEntry,   getFullElements,   getFullNonNullElements,   getFullNonNullStringElements,   getOtherElements,   getOtherNonNullElements,   getOtherNonNullStringElements,   isAddSupported,   isEqualsCheckable,   isFailFastSupported,   isNullSupported,   isRemoveSupported,   makeCollection,   makeConfirmedCollection,   makeConfirmedFullCollection,   makeFullCollection,   makeObject,   resetEmpty,   resetFull,   testCollectionAdd,   testCollectionAddAll,   testCollectionClear,   testCollectionContains,   testCollectionContainsAll,   testCollectionIsEmpty,   testCollectionIterator,   testCollectionIteratorFailFast,   testCollectionIteratorRemove,   testCollectionRemove,   testCollectionRemoveAll,   testCollectionRetainAll,   testCollectionSize,   testCollectionToArray,   testCollectionToArray2,   testCollectionToString,   testSerializeDeserializeThenCompare,   testUnsupportedAdd,   testUnsupportedRemove,   verify
Methods from org.apache.commons.collections.AbstractTestObject:
getCanonicalEmptyCollectionName,   getCanonicalFullCollectionName,   getCompatibilityVersion,   isEqualsCheckable,   isTestSerialization,   makeObject,   readExternalFormFromBytes,   readExternalFormFromDisk,   skipSerializedCanonicalTests,   supportsEmptyCollections,   supportsFullCollections,   testCanonicalEmptyCollectionExists,   testCanonicalFullCollectionExists,   testEqualsNull,   testObjectEqualsSelf,   testObjectHashCodeEqualsContract,   testObjectHashCodeEqualsSelfHashCode,   testSerializeDeserializeThenCompare,   testSimpleSerialization,   writeExternalFormToBytes,   writeExternalFormToDisk
Methods from org.apache.commons.collections.BulkTest:
clone,   ignoredSimpleTests,   makeSuite,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.collections.set.AbstractTestSet Detail:
 public Set getConfirmedSet() 
 public Set getSet() 
 public boolean isEqualsCheckable() 
    Set equals method is defined.
 public final Collection makeCollection() 
 public Collection makeConfirmedCollection() 
    Returns an empty Set for use in modification testing.
 public Collection makeConfirmedFullCollection() 
    Returns a full Set for use in modification testing.
 abstract public Set makeEmptySet()
    Makes an empty set. The returned set should have no elements.
 public final Collection makeFullCollection() 
 public Set makeFullSet() 
    Makes a full set by first creating an empty set and then adding all the elements returned by #getFullElements() . Override if your set does not support the add operation.
 public  void testSetEquals() 
 public  void testSetHashCode() 
 public  void verify() 
    Provides additional verifications for sets.