Class 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
    • 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.
      • 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.