org.apache.commons.collections.comparators
public abstract class AbstractTestComparator extends AbstractTestObject
Concrete subclasses declare the comparator to be tested. They also declare certain aspects of the tests.
| Constructor Summary | |
|---|---|
| AbstractTestComparator(String testName)
JUnit constructor.
| |
| Method Summary | |
|---|---|
| String | getCanonicalComparatorName(Object object) |
| abstract List | getComparableObjectsOrdered()
Implement this method to return a list of sorted objects.
|
| String | getCompatibilityVersion()
Overrides superclass to set the compatability to version 2
as there were no Comparators in version 1.x. |
| abstract Comparator | makeComparator()
Implement this method to return the comparator to test.
|
| Object | makeObject()
Implements the abstract superclass method to return the comparator.
|
| protected void | randomizeObjects(List list)
Randomize the list. |
| protected void | reverseObjects(List list)
Reverse the list. |
| protected void | sortObjects(List list, Comparator comparator)
Sort the list. |
| boolean | supportsEmptyCollections()
Overrides superclass to block tests. |
| boolean | supportsFullCollections()
Overrides superclass to block tests. |
| 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()
Test sorting an empty list |
| void | testRandomListSort()
Test sorting a random list. |
| void | testReverseListSort()
Test sorting a reversed list. |
Parameters: testName the test class name
Returns: sorted objects
Returns: the comparator to test
Returns: a full iterator