aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/junit/framework/JUnit4TestAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/junit/framework/JUnit4TestAdapter.java')
-rw-r--r--src/main/java/junit/framework/JUnit4TestAdapter.java25
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