From aa1524950fb5fbffbb61d23c5442984cb731a1eb Mon Sep 17 00:00:00 2001 From: Pete Bentley Date: Sun, 21 Feb 2021 18:26:28 +0000 Subject: Upgrade external/junit to 4.13.2 Contains just the changes from 4.12 to 4.13.2 and undoes local Android changes. Will re-patch those in in subsequent CLs. Bug: 129054170 Test: m Change-Id: I5ec909df6840f6c54cbab9c509c5addaee3f94e6 --- .../java/junit/framework/JUnit4TestAdapter.java | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/main/java/junit/framework/JUnit4TestAdapter.java') diff --git a/src/main/java/junit/framework/JUnit4TestAdapter.java b/src/main/java/junit/framework/JUnit4TestAdapter.java index cbb66db..9d32031 100644 --- a/src/main/java/junit/framework/JUnit4TestAdapter.java +++ b/src/main/java/junit/framework/JUnit4TestAdapter.java @@ -9,11 +9,23 @@ import org.junit.runner.Request; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filter; import org.junit.runner.manipulation.Filterable; +import org.junit.runner.manipulation.Orderer; +import org.junit.runner.manipulation.InvalidOrderingException; import org.junit.runner.manipulation.NoTestsRemainException; -import org.junit.runner.manipulation.Sortable; +import org.junit.runner.manipulation.Orderable; import org.junit.runner.manipulation.Sorter; -public class JUnit4TestAdapter implements Test, Filterable, Sortable, Describable { +/** + * The JUnit4TestAdapter enables running JUnit-4-style tests using a JUnit-3-style test runner. + * + *

To use it, add the following to a test class: + *

+      public static Test suite() {
+        return new JUnit4TestAdapter(YourJUnit4TestClass.class);
+      }
+
+ */ +public class JUnit4TestAdapter implements Test, Filterable, Orderable, Describable { private final Class fNewTestClass; private final Runner fRunner; @@ -83,4 +95,13 @@ public class JUnit4TestAdapter implements Test, Filterable, Sortable, Describabl public void sort(Sorter sorter) { sorter.apply(fRunner); } + + /** + * {@inheritDoc} + * + * @since 4.13 + */ + public void order(Orderer orderer) throws InvalidOrderingException { + orderer.apply(fRunner); + } } \ No newline at end of file -- cgit v1.2.3