Class AbstractTestSortedSet
- java.lang.Object
-
- junit.framework.Assert
-
- 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
-
- 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 forSortedSetmethods 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; seeAbstractTestCollectionfor more details.- Since:
- Commons Collections 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractTestSortedSet.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
Constructors Constructor Description AbstractTestSortedSet(java.lang.String name)JUnit constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkTestbulkTestSortedSetHeadSet()Bulk testSortedSet.headSet(Object).BulkTestbulkTestSortedSetSubSet()Bulk testSortedSet.subSet(Object, Object).BulkTestbulkTestSortedSetTailSet()Bulk testSortedSet.tailSet(Object).java.util.SortedSetgetConfirmedSortedSet()Return theAbstractTestCollection#confirmedfixture, but cast as a SortedSet.java.lang.Object[]getFullNonNullElements()Override to return comparable objects.java.lang.Object[]getOtherNonNullElements()Override to return comparable objects.booleanisNullSupported()Overridden because SortedSets don't allow null elements (normally).java.util.CollectionmakeConfirmedCollection()Returns an emptyTreeSetfor use in modification testing.voidverify()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
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
-
-
-
-
Method Detail
-
verify
public void verify()
Verification extension, will check the order of elements, the sets should already be verified equal.- Overrides:
verifyin classAbstractTestSet
-
isNullSupported
public boolean isNullSupported()
Overridden because SortedSets don't allow null elements (normally).- Overrides:
isNullSupportedin classAbstractTestCollection- Returns:
- false
-
makeConfirmedCollection
public java.util.Collection makeConfirmedCollection()
Returns an emptyTreeSetfor use in modification testing.- Overrides:
makeConfirmedCollectionin classAbstractTestSet- Returns:
- a confirmed empty collection
-
getConfirmedSortedSet
public java.util.SortedSet getConfirmedSortedSet()
Return theAbstractTestCollection#confirmedfixture, but cast as a SortedSet.
-
getFullNonNullElements
public java.lang.Object[] getFullNonNullElements()
Override to return comparable objects.- Overrides:
getFullNonNullElementsin classAbstractTestCollection
-
getOtherNonNullElements
public java.lang.Object[] getOtherNonNullElements()
Override to return comparable objects.- Overrides:
getOtherNonNullElementsin classAbstractTestCollection
-
bulkTestSortedSetSubSet
public BulkTest bulkTestSortedSetSubSet()
Bulk testSortedSet.subSet(Object, Object). This method runs through all of the tests inAbstractTestSortedSet. After modification operations,verify()is invoked to ensure that the set and the other collection views are still valid.- Returns:
- a
AbstractTestSetinstance for testing a subset.
-
bulkTestSortedSetHeadSet
public BulkTest bulkTestSortedSetHeadSet()
Bulk testSortedSet.headSet(Object). This method runs through all of the tests inAbstractTestSortedSet. After modification operations,verify()is invoked to ensure that the set and the other collection views are still valid.- Returns:
- a
AbstractTestSetinstance for testing a headset.
-
bulkTestSortedSetTailSet
public BulkTest bulkTestSortedSetTailSet()
Bulk testSortedSet.tailSet(Object). This method runs through all of the tests inAbstractTestSortedSet. After modification operations,verify()is invoked to ensure that the set and the other collection views are still valid.- Returns:
- a
AbstractTestSetinstance for testing a tailset.
-
-