aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/runner/manipulation/Alphanumeric.java
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2021-03-03 15:09:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-03 15:09:19 +0000
commit4ea71685c0a1bda87567b2d1ef5ed651d9c2608b (patch)
tree10923530939981dd1dc5f44ceb6316fb9442428a /src/main/java/org/junit/runner/manipulation/Alphanumeric.java
parent5cb7d97d73027edb2274ac39e8a958bab5e2e7b3 (diff)
parenta9a7715d84046efd231e038b0dc2f551daf61701 (diff)
downloadjunit-4ea71685c0a1bda87567b2d1ef5ed651d9c2608b.tar.gz
Merge changes I578a2676,I4b37c2d0,Id1e2d638,I1ebe37da,I6135799c am: b6446bec0a am: fcd81b3e3f am: c7a6d4ec7d am: a9a7715d84
Original change: https://android-review.googlesource.com/c/platform/external/junit/+/1613132 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I56f45d05317bd1060b5838f1ada3a90bb2985d55
Diffstat (limited to 'src/main/java/org/junit/runner/manipulation/Alphanumeric.java')
-rw-r--r--src/main/java/org/junit/runner/manipulation/Alphanumeric.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/org/junit/runner/manipulation/Alphanumeric.java b/src/main/java/org/junit/runner/manipulation/Alphanumeric.java
new file mode 100644
index 0000000..8388d21
--- /dev/null
+++ b/src/main/java/org/junit/runner/manipulation/Alphanumeric.java
@@ -0,0 +1,27 @@
+package org.junit.runner.manipulation;
+
+import java.util.Comparator;
+
+import org.junit.runner.Description;
+
+/**
+ * A sorter that orders tests alphanumerically by test name.
+ *
+ * @since 4.13
+ */
+public final class Alphanumeric extends Sorter implements Ordering.Factory {
+
+ public Alphanumeric() {
+ super(COMPARATOR);
+ }
+
+ public Ordering create(Context context) {
+ return this;
+ }
+
+ private static final Comparator<Description> COMPARATOR = new Comparator<Description>() {
+ public int compare(Description o1, Description o2) {
+ return o1.getDisplayName().compareTo(o2.getDisplayName());
+ }
+ };
+}