|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.JUnit4TestAdapter
public class JUnit4TestAdapter
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);
}
| Constructor Summary | |
|---|---|
JUnit4TestAdapter(Class<?> newTestClass)
|
|
JUnit4TestAdapter(Class<?> newTestClass,
JUnit4TestAdapterCache cache)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JUnit4TestAdapter(Class<?> newTestClass)
public JUnit4TestAdapter(Class<?> newTestClass,
JUnit4TestAdapterCache cache)
| Method Detail |
|---|
public int countTestCases()
Test
countTestCases in interface Testpublic void run(TestResult result)
Test
run in interface Testpublic List<Test> getTests()
public Class<?> getTestClass()
public Description getDescription()
getDescription in interface DescribableDescription showing the tests to be run by the receiverpublic String toString()
toString in class Object
public void filter(Filter filter)
throws NoTestsRemainException
Filterablefilter.
filter in interface Filterablefilter - the Filter to apply
NoTestsRemainException - if all tests are filtered outpublic void sort(Sorter sorter)
Sortablesorter
sort in interface Sortablesorter - the Sorter to use for sorting the tests
public void order(Orderer orderer)
throws InvalidOrderingException
orderer
order in interface OrderableInvalidOrderingException - if orderer does something invalid (like remove or add
children)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||