Class Sorter
java.lang.Object
org.junit.runner.manipulation.Ordering
org.junit.runner.manipulation.Sorter
- All Implemented Interfaces:
Comparator<Description>
- Direct Known Subclasses:
Alphanumeric
A
Sorter orders tests. In general you will not need
to use a Sorter directly. Instead, use
Request.sortWith(Comparator).- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Ordering
Ordering.Context, Ordering.Factory -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSorter(Comparator<Description> comparator) Creates aSorterthat usescomparatorto sort tests -
Method Summary
Modifier and TypeMethodDescriptionvoidSorts the tests intargetusingcomparator.intcompare(Description o1, Description o2) protected final List<Description> orderItems(Collection<Description> descriptions) Implemented by sub-classes to order the descriptions.Methods inherited from class Ordering
definedBy, definedBy, shuffledByMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
NULL
NULL is aSorterthat leaves elements in an undefined order
-
-
Constructor Details
-
Sorter
Creates aSorterthat usescomparatorto sort tests- Parameters:
comparator- theComparatorto use when sorting tests- Since:
- 4.0
-
-
Method Details
-
apply
-
compare
- Specified by:
comparein interfaceComparator<Description>
-
orderItems
Implemented by sub-classes to order the descriptions.- Specified by:
orderItemsin classOrdering- Returns:
- descriptions in order
- Since:
- 4.13
-