org.apache.commons.collections.set

Class AbstractTestSortedSet

public abstract class AbstractTestSortedSet extends AbstractTestSet

Abstract test class for {@link SortedSet} methods and contracts.

To use, subclass and override the {@link #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 {@link AbstractTestCollection} for more details.

Since: Commons Collections 3.0

Nested Class Summary
classAbstractTestSortedSet.TestSortedSetSubSet
Constructor Summary
AbstractTestSortedSet(String name)
JUnit constructor.
Method Summary
BulkTestbulkTestSortedSetHeadSet()
Bulk test {@link SortedSet#headSet(Object)}.
BulkTestbulkTestSortedSetSubSet()
Bulk test {@link SortedSet#subSet(Object, Object)}.
BulkTestbulkTestSortedSetTailSet()
Bulk test {@link SortedSet#tailSet(Object)}.
SortedSetgetConfirmedSortedSet()
Return the {@link AbstractTestCollection#confirmed} fixture, but cast as a SortedSet.
Object[]getFullNonNullElements()
Override to return comparable objects.
Object[]getOtherNonNullElements()
Override to return comparable objects.
booleanisNullSupported()
Overridden because SortedSets don't allow null elements (normally).
CollectionmakeConfirmedCollection()
Returns an empty {@link TreeSet} for use in modification testing.
voidverify()
Verification extension, will check the order of elements, the sets should already be verified equal.

Constructor Detail

AbstractTestSortedSet

public AbstractTestSortedSet(String name)
JUnit constructor.

Parameters: name name for test

Method Detail

bulkTestSortedSetHeadSet

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

Returns: a {@link AbstractTestSet} instance for testing a headset.

bulkTestSortedSetSubSet

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

Returns: a {@link AbstractTestSet} instance for testing a subset.

bulkTestSortedSetTailSet

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

Returns: a {@link AbstractTestSet} instance for testing a tailset.

getConfirmedSortedSet

public SortedSet getConfirmedSortedSet()
Return the {@link AbstractTestCollection#confirmed} fixture, but cast as a SortedSet.

getFullNonNullElements

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

getOtherNonNullElements

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

isNullSupported

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

Returns: false

makeConfirmedCollection

public Collection makeConfirmedCollection()
Returns an empty {@link TreeSet} for use in modification testing.

Returns: a confirmed empty collection

verify

public void verify()
Verification extension, will check the order of elements, the sets should already be verified equal.
Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.