public class DataProviderRunner
extends org.junit.runners.BlockJUnit4ClassRunner
Object[][] (see DataProvider).
Your test method must be annotated with @UseDataProvider or @DataProvider,
additionally.
| Modifier and Type | Field and Description |
|---|---|
protected DataConverter |
dataConverter
The
DataConverter to be used to convert from supported return types of any dataprovider to List
<Object[]> such that data can be further handled. |
protected TestGenerator |
testGenerator
The
TestGenerator to be used to generate all framework methods to be executed as test (enhanced by data
providers data if desired). |
protected TestValidator |
testValidator
The
TestValidator to be used to validate all test methods to be executed as test and all dataprovider to
be used to explode tests. |
| 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) |
protected void |
initializeHelpers()
|
protected void |
validateInstanceMethods(java.util.List<java.lang.Throwable> errors)
Deprecated.
|
protected void |
validateTestMethods(java.util.List<java.lang.Throwable> errors) |
createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutprotected DataConverter dataConverter
DataConverter to be used to convert from supported return types of any dataprovider to List
<Object[]> such that data can be further handled.protected TestGenerator testGenerator
TestGenerator to be used to generate all framework methods to be executed as test (enhanced by data
providers data if desired).protected TestValidator testValidator
TestValidator to be used to validate all test methods to be executed as test and all dataprovider to
be used to explode tests.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.BlockJUnit4ClassRunnerprotected void initializeHelpers()
@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 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