aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/runner/manipulation/Orderer.java
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-02-24 15:52:50 +0000
committerDavid Srbecky <dsrbecky@google.com>2021-02-24 15:52:50 +0000
commit08a6d4b74555db6d01048fc7065eb1e2bfaf33bc (patch)
tree81124de095a6b4a53b223d0f70cadde9744ee44a /src/main/java/org/junit/runner/manipulation/Orderer.java
parent6a658e7a4df0cc8ea6465da46fcf1a823cb0d491 (diff)
downloadjunit-08a6d4b74555db6d01048fc7065eb1e2bfaf33bc.tar.gz
Revert "Upgrade external/junit to 4.13.2"
Revert submission 1601635 Reason for revert: b/181123058 Reverted Changes: I8f5cd1266:Remove support for stuck threads Ifdb59336d:Remove DisableOnDebug (new in 4.12) as it is not s... I6abae5aed:Extra generic type information to aid certain java... I5ec909df6:Upgrade external/junit to 4.13.2 Change-Id: Idaddfc2039816a8d7b12c91fdd540b801ab854ff
Diffstat (limited to 'src/main/java/org/junit/runner/manipulation/Orderer.java')
-rw-r--r--src/main/java/org/junit/runner/manipulation/Orderer.java62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/main/java/org/junit/runner/manipulation/Orderer.java b/src/main/java/org/junit/runner/manipulation/Orderer.java
deleted file mode 100644
index eb13054..0000000
--- a/src/main/java/org/junit/runner/manipulation/Orderer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.junit.runner.manipulation;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.runner.Description;
-
-/**
- * Orders tests.
- *
- * @since 4.13
- */
-public final class Orderer {
- private final Ordering ordering;
-
- Orderer(Ordering delegate) {
- this.ordering = delegate;
- }
-
- /**
- * Orders the descriptions.
- *
- * @return descriptions in order
- */
- public List<Description> order(Collection<Description> descriptions)
- throws InvalidOrderingException {
- List<Description> inOrder = ordering.orderItems(
- Collections.unmodifiableCollection(descriptions));
- if (!ordering.validateOrderingIsCorrect()) {
- return inOrder;
- }
-
- Set<Description> uniqueDescriptions = new HashSet<Description>(descriptions);
- if (!uniqueDescriptions.containsAll(inOrder)) {
- throw new InvalidOrderingException("Ordering added items");
- }
- Set<Description> resultAsSet = new HashSet<Description>(inOrder);
- if (resultAsSet.size() != inOrder.size()) {
- throw new InvalidOrderingException("Ordering duplicated items");
- } else if (!resultAsSet.containsAll(uniqueDescriptions)) {
- throw new InvalidOrderingException("Ordering removed items");
- }
-
- return inOrder;
- }
-
- /**
- * Order the tests in <code>target</code>.
- *
- * @throws InvalidOrderingException if ordering does something invalid (like remove or add
- * children)
- */
- public void apply(Object target) throws InvalidOrderingException {
- if (target instanceof Orderable) {
- Orderable orderable = (Orderable) target;
- orderable.order(this);
- }
- }
-}