public class TestValidator
extends java.lang.Object
Constructor and Description |
---|
TestValidator(DataConverter dataConverter) |
Modifier and Type | Method and Description |
---|---|
void |
validateDataProviderMethod(org.junit.runners.model.FrameworkMethod dataProviderMethod,
DataProvider dataProvider,
java.util.List<java.lang.Throwable> errors)
Checks if the given
dataProviderMethod is a valid dataprovider and adds a Exception to
errors if it
is not public,
is not static,
takes parameters, or
does return a convertible type, see DataConverter.canConvert(java.lang.reflect.Type)
This method is package private (= visible) for testing. |
void |
validateTestMethod(org.junit.runners.model.FrameworkMethod testMethod,
java.util.List<java.lang.Throwable> errors)
Checks if the given
testMethod is a valid test method depending on the dataprovider relevant annotation
@ DataProvider and @ UseDataProvider . |
public TestValidator(DataConverter dataConverter)
public void validateTestMethod(org.junit.runners.model.FrameworkMethod testMethod, java.util.List<java.lang.Throwable> errors)
testMethod
is a valid test method depending on the dataprovider relevant annotation
@
DataProvider
and @
UseDataProvider
. Adds Exception
s to errors
for
each invalid property. A normal test method must be is public, void instance method with no arguments. A data
provider test method must be is public and void instance method but have a least one argument.testMethod
- the test method to be validatederrors
- java.lang.IllegalArgumentException
- if given errors
is null
public void validateDataProviderMethod(org.junit.runners.model.FrameworkMethod dataProviderMethod, DataProvider dataProvider, java.util.List<java.lang.Throwable> errors)
dataProviderMethod
is a valid dataprovider and adds a Exception
to
errors
if it
DataConverter.canConvert(java.lang.reflect.Type)
This method is package private (= visible) for testing.
dataProviderMethod
- the method to checkdataProvider
- the @
DataProvider
annotation used on dataProviderMethod
errors
- to be "returned" and thrown as InitializationError
java.lang.NullPointerException
- iif any argument is null