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 forSortedSet
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; seeAbstractTestCollection
for more details.- Since:
- Commons Collections 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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
Constructors Constructor Description AbstractTestSortedSet(java.lang.String name)
JUnit constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkTest
bulkTestSortedSetHeadSet()
Bulk testSortedSet.headSet(Object)
.BulkTest
bulkTestSortedSetSubSet()
Bulk testSortedSet.subSet(Object, Object)
.BulkTest
bulkTestSortedSetTailSet()
Bulk testSortedSet.tailSet(Object)
.java.util.SortedSet
getConfirmedSortedSet()
Return theAbstractTestCollection#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 emptyTreeSet
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
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:
verify
in classAbstractTestSet
-
isNullSupported
public boolean isNullSupported()
Overridden because SortedSets don't allow null elements (normally).- Overrides:
isNullSupported
in classAbstractTestCollection
- Returns:
- false
-
makeConfirmedCollection
public java.util.Collection makeConfirmedCollection()
Returns an emptyTreeSet
for use in modification testing.- Overrides:
makeConfirmedCollection
in classAbstractTestSet
- Returns:
- a confirmed empty collection
-
getConfirmedSortedSet
public java.util.SortedSet getConfirmedSortedSet()
Return theAbstractTestCollection#confirmed
fixture, but cast as a SortedSet.
-
getFullNonNullElements
public java.lang.Object[] getFullNonNullElements()
Override to return comparable objects.- Overrides:
getFullNonNullElements
in classAbstractTestCollection
-
getOtherNonNullElements
public java.lang.Object[] getOtherNonNullElements()
Override to return comparable objects.- Overrides:
getOtherNonNullElements
in 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
AbstractTestSet
instance 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
AbstractTestSet
instance 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
AbstractTestSet
instance for testing a tailset.
-
-