Skip to content

Commit

Permalink
changes as suggested by kcooney
Browse files Browse the repository at this point in the history
  • Loading branch information
ibeauregard committed May 31, 2012
1 parent ec7fd69 commit 8424e26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/junit/internal/MethodSorter.java
Expand Up @@ -22,14 +22,13 @@ public int compare(Method m1, Method m2) {
};

/**
* Method name ascending lexicographic sort order, with toString as a tiebreaker
* Method name ascending lexicographic sort order, with {@link Method#toString()} as a tiebreaker
*/
public static Comparator<Method> NAME_ASCENDING= new Comparator<Method>() {
public int compare(Method m1, Method m2) {
final int comparison = m1.getName().compareTo(m2.getName());
if (comparison != 0) {
if (comparison != 0)
return comparison;
}
return m1.toString().compareTo(m2.toString());
}
};
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/junit/runners/MethodSorters.java
Expand Up @@ -10,11 +10,16 @@
* Defines common {@link MethodSorter} implementations.
*/
public enum MethodSorters {
/** Sorts the test methods by the method name, in lexicographic order, with Method.toString used as a tiebreaker */
/** 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 my vary from run to run */
* 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);

Expand Down

0 comments on commit 8424e26

Please sign in to comment.