public class JUnit4TestAdapter extends Object implements Test, Filterable, Orderable, Describable
To use it, add the following to a test class:
public static Test suite() {
return new JUnit4TestAdapter(YourJUnit4TestClass.class);
}
| Constructor and Description |
|---|
JUnit4TestAdapter(Class<?> newTestClass) |
JUnit4TestAdapter(Class<?> newTestClass,
JUnit4TestAdapterCache cache) |
| Modifier and Type | Method and Description |
|---|---|
int |
countTestCases()
Counts the number of test cases that will be run by this test.
|
void |
filter(Filter filter)
Remove tests that don't pass the parameter
filter. |
Description |
getDescription() |
Class<?> |
getTestClass() |
List<Test> |
getTests() |
void |
order(Orderer orderer)
Orders the tests using
orderer |
void |
run(TestResult result)
Runs a test and collects its result in a TestResult instance.
|
void |
sort(Sorter sorter)
Sorts the tests using
sorter |
String |
toString() |
public JUnit4TestAdapter(Class<?> newTestClass)
public JUnit4TestAdapter(Class<?> newTestClass, JUnit4TestAdapterCache cache)
public int countTestCases()
TestcountTestCases in interface Testpublic void run(TestResult result)
Testpublic Class<?> getTestClass()
public Description getDescription()
getDescription in interface DescribableDescription showing the tests to be run by the receiverpublic void filter(Filter filter) throws NoTestsRemainException
Filterablefilter.filter in interface Filterablefilter - the Filter to applyNoTestsRemainException - if all tests are filtered outpublic void sort(Sorter sorter)
Sortablesorterpublic void order(Orderer orderer) throws InvalidOrderingException
ordererorder in interface OrderableInvalidOrderingException - if orderer does something invalid (like remove or add
children)Copyright © 2002–2020 JUnit. All rights reserved.