|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.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 Test
public void run(TestResult result)
Test
run
in interface Test
public List<Test> getTests()
public Class<?> getTestClass()
public Description getDescription()
getDescription
in interface Describable
Description
showing the tests to be run by the receiverpublic String toString()
toString
in class Object
public void filter(Filter filter) throws NoTestsRemainException
Filterable
filter
.
filter
in interface Filterable
filter
- the Filter
to apply
NoTestsRemainException
- if all tests are filtered outpublic void sort(Sorter sorter)
Sortable
sorter
sort
in interface Sortable
sorter
- the Sorter
to use for sorting the testspublic void order(Orderer orderer) throws InvalidOrderingException
orderer
order
in interface Orderable
InvalidOrderingException
- 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 |