org.apache.commons.collections.set
Class AbstractTestSortedSet

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.collections.BulkTest
              extended by org.apache.commons.collections.AbstractTestObject
                  extended by org.apache.commons.collections.collection.AbstractTestCollection
                      extended by org.apache.commons.collections.set.AbstractTestSet
                          extended by org.apache.commons.collections.set.AbstractTestSortedSet
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Direct Known Subclasses:
AbstractTestSortedSet.TestSortedSetSubSet

public abstract class AbstractTestSortedSet
extends AbstractTestSet

Abstract test class for SortedSet methods and contracts.

To use, subclass and override the AbstractTestSet.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.

Since:
Commons Collections 3.0

Nested Class Summary
 class AbstractTestSortedSet.TestSortedSetSubSet
           
 
Field Summary
 
Fields inherited from class org.apache.commons.collections.collection.AbstractTestCollection
collection, confirmed
 
Fields inherited from class org.apache.commons.collections.AbstractTestObject
COLLECTIONS_MAJOR_VERSION
 
Constructor Summary
AbstractTestSortedSet(java.lang.String name)
          JUnit constructor.
 
Method Summary
 BulkTest bulkTestSortedSetHeadSet()
          Bulk test SortedSet.headSet(Object).
 BulkTest bulkTestSortedSetSubSet()
          Bulk test SortedSet.subSet(Object, Object).
 BulkTest bulkTestSortedSetTailSet()
          Bulk test SortedSet.tailSet(Object).
 java.util.SortedSet getConfirmedSortedSet()
          Return the AbstractTestCollection#confirmed fixture, but cast as a SortedSet.
 java.lang.Object[] getFullNonNullElements()
          Override to return comparable objects.
 java.lang.Object[] getOtherNonNullElements()
          Override to return comparable objects.
 boolean isNullSupported()
          Overridden because SortedSets don't allow null elements (normally).
 java.util.Collection makeConfirmedCollection()
          Returns an empty TreeSet for use in modification testing.
 void verify()
          Verification extension, will check the order of elements, the sets should already be verified equal.
 
Methods inherited from class org.apache.commons.collections.set.AbstractTestSet
getConfirmedSet, getSet, isEqualsCheckable, makeCollection, makeConfirmedFullCollection, makeEmptySet, makeFullCollection, makeFullSet, testSetEquals, testSetHashCode
 
Methods inherited from class org.apache.commons.collections.collection.AbstractTestCollection
areEqualElementsDistinguishable, cloneMapEntry, getFullElements, getFullNonNullStringElements, getOtherElements, getOtherNonNullStringElements, isAddSupported, isFailFastSupported, isRemoveSupported, makeObject, resetEmpty, resetFull, testCollectionAdd, testCollectionAddAll, testCollectionClear, testCollectionContains, testCollectionContainsAll, testCollectionIsEmpty, testCollectionIterator, testCollectionIteratorFailFast, testCollectionIteratorRemove, testCollectionRemove, testCollectionRemoveAll, testCollectionRetainAll, testCollectionSize, testCollectionToArray, testCollectionToArray2, testCollectionToString, testSerializeDeserializeThenCompare, testUnsupportedAdd, testUnsupportedRemove
 
Methods inherited from class org.apache.commons.collections.AbstractTestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, isTestSerialization, readExternalFormFromBytes, readExternalFormFromDisk, skipSerializedCanonicalTests, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testEqualsNull, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
 
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredTests, makeSuite, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown
 
Methods inherited from class junit.framework.Assert
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, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTestSortedSet

public AbstractTestSortedSet(java.lang.String name)
JUnit constructor.

Parameters:
name - name for test
Method Detail

verify

public void verify()
Verification extension, will check the order of elements, the sets should already be verified equal.

Overrides:
verify in class AbstractTestSet

isNullSupported

public boolean isNullSupported()
Overridden because SortedSets don't allow null elements (normally).

Overrides:
isNullSupported in class AbstractTestCollection
Returns:
false

makeConfirmedCollection

public java.util.Collection makeConfirmedCollection()
Returns an empty TreeSet for use in modification testing.

Overrides:
makeConfirmedCollection in class AbstractTestSet
Returns:
a confirmed empty collection

getConfirmedSortedSet

public java.util.SortedSet getConfirmedSortedSet()
Return the AbstractTestCollection#confirmed fixture, but cast as a SortedSet.


getFullNonNullElements

public java.lang.Object[] getFullNonNullElements()
Override to return comparable objects.

Overrides:
getFullNonNullElements in class AbstractTestCollection

getOtherNonNullElements

public java.lang.Object[] getOtherNonNullElements()
Override to return comparable objects.

Overrides:
getOtherNonNullElements in class AbstractTestCollection

bulkTestSortedSetSubSet

public BulkTest bulkTestSortedSetSubSet()
Bulk test SortedSet.subSet(Object, Object). This method runs through all of the tests in AbstractTestSortedSet. After modification operations, verify() is invoked to ensure that the set and the other collection views are still valid.

Returns:
a AbstractTestSet instance for testing a subset.

bulkTestSortedSetHeadSet

public BulkTest bulkTestSortedSetHeadSet()
Bulk test SortedSet.headSet(Object). This method runs through all of the tests in AbstractTestSortedSet. After modification operations, verify() is invoked to ensure that the set and the other collection views are still valid.

Returns:
a AbstractTestSet instance for testing a headset.

bulkTestSortedSetTailSet

public BulkTest bulkTestSortedSetTailSet()
Bulk test SortedSet.tailSet(Object). This method runs through all of the tests in AbstractTestSortedSet. After modification operations, verify() is invoked to ensure that the set and the other collection views are still valid.

Returns:
a AbstractTestSet instance for testing a tailset.


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.