public class DataProviderRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Object
[][]
(see DataProvider
).
Your test method must be annotated with @
UseDataProvider
or @
DataProvider
,
additionally.
Constructor and Description |
---|
DataProviderRunner(java.lang.Class<?> clazz)
Creates a DataProviderRunner to run supplied
clazz . |
Modifier and Type | Method and Description |
---|---|
protected org.junit.runners.model.Statement |
childrenInvoker(org.junit.runner.notification.RunNotifier notifier)
Just overridden to make
classBlock(RunNotifier) testable. |
protected org.junit.runners.model.Statement |
classBlock(org.junit.runner.notification.RunNotifier notifier)
Overridden due to
@ BeforeClass methods are already processed, see computeTestMethods()
and invokeBeforeClass() . |
protected void |
collectInitializationErrors(java.util.List<java.lang.Throwable> errors) |
protected java.util.List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods()
Generates the exploded list of methods that run tests.
|
void |
filter(org.junit.runner.manipulation.Filter filter)
If possible the given
filter is wrapped by DataProviderFilter to enable filtering of tests using
a dataprovider. |
protected void |
validateTestMethods(java.util.List<java.lang.Throwable> errors)
Additionally validates dataproviders.
|
createTest, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateInstanceMethods, validateOnlyOneConstructor, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
public DataProviderRunner(java.lang.Class<?> clazz) throws org.junit.runners.model.InitializationError
clazz
.clazz
- the test Class
to runorg.junit.runners.model.InitializationError
- if the test Class
is malformed.protected void collectInitializationErrors(java.util.List<java.lang.Throwable> errors)
collectInitializationErrors
in class org.junit.runners.BlockJUnit4ClassRunner
protected void validateTestMethods(java.util.List<java.lang.Throwable> errors)
Additionally validates dataproviders.
validateTestMethods
in class org.junit.runners.BlockJUnit4ClassRunner
errors
- that are added to this listjava.lang.NullPointerException
- if given errors
is null
protected org.junit.runners.model.Statement classBlock(org.junit.runner.notification.RunNotifier notifier)
Overridden due to @
BeforeClass
methods are already processed, see computeTestMethods()
and invokeBeforeClass()
. Just add a Statement
which is processing potential caught
Throwable
while @BeforeClass
methods have been executed before.
classBlock
in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
notifier
- to be used while processing Statement
, e.g. for setup, children and tear downStatement
to be evaluatedprotected org.junit.runners.model.Statement childrenInvoker(org.junit.runner.notification.RunNotifier notifier)
Just overridden to make classBlock(RunNotifier)
testable. Just invokes super
.
childrenInvoker
in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
notifier
- to be used while processing childrenStatement
to be evaluated to invoke childrenprotected java.util.List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
@Test
on this class and
super classes that are not overridden are checked if they use a @
DataProvider
or not. If yes, for
each row of the DataProvider
s result a specific, parameterized test method will be added. If not, the
original test method is added.
Additionally, caches the result as computeTestMethods()
is call multiple times while test execution by
the JUnit framework (to validate, to filter, to execute, ...).
computeTestMethods
in class org.junit.runners.BlockJUnit4ClassRunner
null
)public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException
If possible the given filter
is wrapped by DataProviderFilter
to enable filtering of tests using
a dataprovider.
filter
in interface org.junit.runner.manipulation.Filterable
filter
in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
filter
- the Filter
to be wrapped or apply, respectivelyorg.junit.runner.manipulation.NoTestsRemainException