Keel 2.1RC2

org.apache.commons.collections.comparators
Class TestComparator

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.commons.collections.BulkTest
              extended byorg.apache.commons.collections.TestObject
                  extended byorg.apache.commons.collections.comparators.TestComparator
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Direct Known Subclasses:
TestComparableComparator, TestComparatorChain, TestNullComparator, TestReverseComparator

public abstract class TestComparator
extends TestObject


Field Summary
 
Fields inherited from class org.apache.commons.collections.TestObject
COLLECTIONS_MAJOR_VERSION
 
Fields inherited from class org.apache.commons.collections.BulkTest
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestComparator(java.lang.String testName)
           
 
Method Summary
 java.lang.String getCanonicalComparatorName(java.lang.Object object)
           
abstract  java.util.List getComparableObjectsOrdered()
           
 int getCompatibilityVersion()
          There were no Comparators in version 1.x.
abstract  java.util.Comparator makeComparator()
           
 java.lang.Object makeObject()
          Return a new, empty Object to used for testing.
 void randomizeObjects(java.util.List list)
           
 void reverseObjects(java.util.List list)
           
 void sortObjects(java.util.List list, java.util.Comparator comparator)
          Sort object according to the given Comparator.
 boolean supportsEmptyCollections()
          Override this method if a subclass is testing a Collections that cannot serialize an "empty" Collection (e.g.
 boolean supportsFullCollections()
          Override this method if a subclass is testing a Collections that cannot serialize a "full" Collection (e.g.
 void testComparatorCompatibility()
          Compare the current serialized form of the Comparator against the canonical version in CVS.
 void testComparatorIsSerializable()
          Nearly all Comparators should be Serializable.
 void testEmptyListSort()
           
 void testRandomListSort()
           
 void testReverseListSort()
           
 
Methods inherited from class org.apache.commons.collections.TestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, readExternalFormFromBytes, readExternalFormFromDisk, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
 
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredSimpleTests, makeSuite, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestComparator

public TestComparator(java.lang.String testName)
Method Detail

makeComparator

public abstract java.util.Comparator makeComparator()

getComparableObjectsOrdered

public abstract java.util.List getComparableObjectsOrdered()

makeObject

public java.lang.Object makeObject()
Description copied from class: TestObject
Return a new, empty Object to used for testing.

Specified by:
makeObject in class TestObject

getCompatibilityVersion

public int getCompatibilityVersion()
There were no Comparators in version 1.x.

Overrides:
getCompatibilityVersion in class TestObject
Returns:
2

reverseObjects

public void reverseObjects(java.util.List list)

randomizeObjects

public void randomizeObjects(java.util.List list)

sortObjects

public void sortObjects(java.util.List list,
                        java.util.Comparator comparator)
Sort object according to the given Comparator.

Parameters:
list - List to sort
comparator - sorting comparator

supportsEmptyCollections

public boolean supportsEmptyCollections()
Description copied from class: TestObject
Override this method if a subclass is testing a Collections that cannot serialize an "empty" Collection (e.g. Comparators have no contents)

Overrides:
supportsEmptyCollections in class TestObject
Returns:
true

supportsFullCollections

public boolean supportsFullCollections()
Description copied from class: TestObject
Override this method if a subclass is testing a Collections that cannot serialize a "full" Collection (e.g. Comparators have no contents)

Overrides:
supportsFullCollections in class TestObject
Returns:
true

testEmptyListSort

public void testEmptyListSort()

testReverseListSort

public void testReverseListSort()

testRandomListSort

public void testRandomListSort()

testComparatorIsSerializable

public void testComparatorIsSerializable()
Nearly all Comparators should be Serializable.


getCanonicalComparatorName

public java.lang.String getCanonicalComparatorName(java.lang.Object object)

testComparatorCompatibility

public void testComparatorCompatibility()
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
Compare the current serialized form of the Comparator against the canonical version in CVS.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.