Package org.junit.runner.manipulation
Class Sorter
- java.lang.Object
-
- org.junit.runner.manipulation.Sorter
-
- All Implemented Interfaces:
java.util.Comparator<Description>
public class Sorter extends java.lang.Object implements java.util.Comparator<Description>
ASorter
orders tests. In general you will not need to use aSorter
directly. Instead, useRequest.sortWith(Comparator)
.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Comparator<Description>
comparator
static Sorter
NULL
NULL is aSorter
that leaves elements in an undefined order
-
Constructor Summary
Constructors Constructor Description Sorter(java.util.Comparator<Description> comparator)
Creates aSorter
that usescomparator
to sort tests
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(java.lang.Object object)
Sorts the test inrunner
usingcomparator
int
compare(Description o1, Description o2)
-
-
-
Field Detail
-
NULL
public static final Sorter NULL
NULL is aSorter
that leaves elements in an undefined order
-
comparator
private final java.util.Comparator<Description> comparator
-
-
Constructor Detail
-
Sorter
public Sorter(java.util.Comparator<Description> comparator)
Creates aSorter
that usescomparator
to sort tests- Parameters:
comparator
- theComparator
to use when sorting tests
-
-
Method Detail
-
apply
public void apply(java.lang.Object object)
Sorts the test inrunner
usingcomparator
-
compare
public int compare(Description o1, Description o2)
- Specified by:
compare
in interfacejava.util.Comparator<Description>
-
-