forked from junit-team/junit4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MethodSorters.java
36 lines (28 loc) · 1000 Bytes
/
MethodSorters.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.junit.runners;
import java.lang.reflect.Method;
import java.util.Comparator;
import org.junit.internal.MethodSorter;
/**
* Sort the methods into a specified execution order.
* Defines common {@link MethodSorter} implementations.
* @since 4.11
*/
public enum MethodSorters {
/** Sorts the test methods by the method name, in lexicographic order,
* with {@link Method#toString()} used as a tiebreaker
*/
NAME_ASCENDING(MethodSorter.NAME_ASCENDING),
/** Leaves the test methods in the order returned by the JVM.
* Note that the order from the JVM may vary from run to run
*/
JVM(null),
/** Sorts the test methods in a deterministic, but not predictable, order */
DEFAULT(MethodSorter.DEFAULT);
private final Comparator<Method> fComparator;
private MethodSorters(Comparator<Method> comparator) {
this.fComparator= comparator;
}
public Comparator<Method> getComparator() {
return fComparator;
}
}