@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface ParameterizedTest
ParameterizedTestCaseRunner to run parameterized test methods in JUnit| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<? extends ParameterGenerator> |
generator
Specify the
ParameterGenerator class used to generate parameters for this test method |
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<? extends java.lang.Throwable> |
expected
Optionally specify
expected, a Throwable, to cause a test method to succeed if
and only if an exception of the specified class is thrown by the method. |
long |
timeout
Optionally specify
timeout in milliseconds to cause a test method to fail if it
takes longer than that number of milliseconds. |
public abstract java.lang.Class<? extends ParameterGenerator> generator
ParameterGenerator class used to generate parameters for this test methodpublic abstract java.lang.Class<? extends java.lang.Throwable> expected
expected, a Throwable, to cause a test method to succeed if
and only if an exception of the specified class is thrown by the method. If the Throwable's
message or one of its properties should be verified, the
ExpectedException rule can be used instead.public abstract long timeout
timeout in milliseconds to cause a test method to fail if it
takes longer than that number of milliseconds.
THREAD SAFETY WARNING: Test methods with a timeout parameter are run in a thread other than the
thread which runs the fixture's @Before and @After methods. This may yield different behavior for
code that is not thread safe when compared to the same test method without a timeout parameter.
Consider using the Timeout rule instead, which ensures a test method is run on the
same thread as the fixture's @Before and @After methods.