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 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 |
validateInstanceMethods(java.util.List<java.lang.Throwable> errors)
Deprecated.
|
protected void |
validateTestMethods(java.util.List<java.lang.Throwable> errors)
Additionally validates dataproviders.
|
protected org.junit.runners.model.Statement |
withBeforeClasses(org.junit.runners.model.Statement statement)
Overridden due to
@BeforeClass methods are already processed, see computeTestMethods()
and invokeBeforeClass(). |
createTest, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateOnlyOneConstructor, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutpublic 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@Deprecated protected void validateInstanceMethods(java.util.List<java.lang.Throwable> errors)
Is copied from BlockJUnit4ClassRunner.validateInstanceMethods(java.util.List<java.lang.Throwable>) because computeTestMethods() must
not be called if validation already found errors!
validateInstanceMethods in class org.junit.runners.BlockJUnit4ClassRunnerprotected void validateTestMethods(java.util.List<java.lang.Throwable> errors)
Additionally validates dataproviders.
validateTestMethods in class org.junit.runners.BlockJUnit4ClassRunnererrors - that are added to this listjava.lang.NullPointerException - if given errors is nullprotected org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
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.
withBeforeClasses in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>Statement to be evaluatedprotected 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 DataProviders 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.BlockJUnit4ClassRunnernull)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.Filterablefilter in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>filter - the Filter to be wrapped or apply, respectivelyorg.junit.runner.manipulation.NoTestsRemainException