org.junit.runners.MethodSorters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactor-junit4 Show documentation
Show all versions of reactor-junit4 Show documentation
JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck.
The newest version!
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 comparator;
private MethodSorters(Comparator comparator) {
this.comparator = comparator;
}
public Comparator getComparator() {
return comparator;
}
}