diff options
author | Pete Bentley <prb@google.com> | 2021-02-24 11:05:43 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-24 11:05:43 +0000 |
commit | 99022df227f5503b68838d97e0a6b3fa5f558f1b (patch) | |
tree | 5ae2f0fddfaf8cf38a22f2e954387f1e59ec6e1f /src/main/java/junit/framework/JUnit4TestAdapter.java | |
parent | 468041bf45125e9964a67db1a51cb2dbed975c69 (diff) | |
parent | 82af4b8b1d440f44b6ebac4db1fd61ae1d35a15e (diff) | |
download | junit-99022df227f5503b68838d97e0a6b3fa5f558f1b.tar.gz |
Merge changes I8f5cd126,Ifdb59336,I6abae5ae,I5ec909df am: d135966357 am: d8911c6e95 am: 82af4b8b1d
Original change: https://android-review.googlesource.com/c/platform/external/junit/+/1601635
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ib180e48a4cc266c12a2d9238385adbb07540d3dc
Diffstat (limited to 'src/main/java/junit/framework/JUnit4TestAdapter.java')
-rw-r--r-- | src/main/java/junit/framework/JUnit4TestAdapter.java | 25 |
1 files changed, 23 insertions, 2 deletions
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. + * + * <p> To use it, add the following to a test class: + * <pre> + public static Test suite() { + return new JUnit4TestAdapter(<em>YourJUnit4TestClass</em>.class); + } +</pre> + */ +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 |