Package junit.framework
Class JUnit4TestAdapter
- java.lang.Object
-
- junit.framework.JUnit4TestAdapter
-
- All Implemented Interfaces:
Test
,Describable
,Filterable
,Sortable
public class JUnit4TestAdapter extends java.lang.Object implements Test, Filterable, Sortable, Describable
-
-
Field Summary
Fields Modifier and Type Field Description private JUnit4TestAdapterCache
fCache
private java.lang.Class<?>
fNewTestClass
private Runner
fRunner
-
Constructor Summary
Constructors Constructor Description JUnit4TestAdapter(java.lang.Class<?> newTestClass)
JUnit4TestAdapter(java.lang.Class<?> newTestClass, JUnit4TestAdapterCache cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 parameterfilter
.Description
getDescription()
java.lang.Class<?>
getTestClass()
java.util.List<Test>
getTests()
private boolean
isIgnored(Description description)
private Description
removeIgnored(Description description)
void
run(TestResult result)
Runs a test and collects its result in a TestResult instance.void
sort(Sorter sorter)
Sorts the tests usingsorter
java.lang.String
toString()
-
-
-
Field Detail
-
fNewTestClass
private final java.lang.Class<?> fNewTestClass
-
fRunner
private final Runner fRunner
-
fCache
private final JUnit4TestAdapterCache fCache
-
-
Constructor Detail
-
JUnit4TestAdapter
public JUnit4TestAdapter(java.lang.Class<?> newTestClass)
-
JUnit4TestAdapter
public JUnit4TestAdapter(java.lang.Class<?> newTestClass, JUnit4TestAdapterCache cache)
-
-
Method Detail
-
countTestCases
public int countTestCases()
Description copied from interface:Test
Counts the number of test cases that will be run by this test.- Specified by:
countTestCases
in interfaceTest
-
run
public void run(TestResult result)
Description copied from interface:Test
Runs a test and collects its result in a TestResult instance.
-
getTests
public java.util.List<Test> getTests()
-
getTestClass
public java.lang.Class<?> getTestClass()
-
getDescription
public Description getDescription()
- Specified by:
getDescription
in interfaceDescribable
- Returns:
- a
Description
showing the tests to be run by the receiver
-
removeIgnored
private Description removeIgnored(Description description)
-
isIgnored
private boolean isIgnored(Description description)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
filter
public void filter(Filter filter) throws NoTestsRemainException
Description copied from interface:Filterable
Remove tests that don't pass the parameterfilter
.- Specified by:
filter
in interfaceFilterable
- Parameters:
filter
- theFilter
to apply- Throws:
NoTestsRemainException
- if all tests are filtered out
-
-