@Retention(RUNTIME)
@Target({METHOD,TYPE})
public @interface Test
| Modifier and Type | Optional Element | Description |
|---|---|---|
boolean |
alwaysRun |
If set to true, this test method will always be run even if it depends
on a method that failed.
|
java.lang.String |
dataProvider |
The name of the data provider for this test method.
|
java.lang.Class<?> |
dataProviderClass |
The class where to look for the data provider.
|
java.lang.String[] |
dependsOnGroups |
The list of groups this method depends on.
|
java.lang.String[] |
dependsOnMethods |
The list of methods this method depends on.
|
java.lang.String |
description |
The description for this method.
|
boolean |
enabled |
Whether methods on this class/method are enabled.
|
java.lang.Class[] |
expectedExceptions |
The list of exceptions that a test method is expected to throw.
|
java.lang.String |
expectedExceptionsMessageRegExp |
If expectedExceptions was specified, its message must match the regular expression
specified in this attribute.
|
java.lang.String[] |
groups |
The list of groups this class/method belongs to.
|
boolean |
ignoreMissingDependencies |
If set to true, this test will run even if the methods
it depends on are missing or excluded.
|
int |
invocationCount |
The number of times this method should be invoked.
|
long |
invocationTimeOut |
The maximum number of milliseconds that the total number of invocations on this test
method should take.
|
java.lang.String[] |
parameters |
Deprecated.
Use @Parameters
|
int |
priority |
The scheduling priority.
|
java.lang.Class |
retryAnalyzer |
The name of the class that should be called to test if the test
should be retried.
|
boolean |
sequential |
Deprecated.
Use singleThreaded
|
boolean |
singleThreaded |
If set to true, all the methods on this test class are guaranteed to run
in the same thread, even if the tests are currently being run with parallel="true".
|
boolean |
skipFailedInvocations |
If true and invocationCount is specified with a value > 1,
then all invocations after a failure will be marked as a SKIP
instead of a FAIL.
|
int |
successPercentage |
The percentage of success expected from this method.
|
java.lang.String |
suiteName |
The name of the suite this test class should be placed in.
|
java.lang.String |
testName |
The name of the test this test class should be placed in.
|
int |
threadPoolSize |
The size of the thread pool for this method.
|
long |
timeOut |
The maximum number of milliseconds this test should take.
|
java.lang.String[] groups
@Deprecated java.lang.String[] parameters
java.lang.String[] dependsOnGroups
java.lang.String[] dependsOnMethods
long timeOut
long invocationTimeOut
int threadPoolSize
int successPercentage
java.lang.String dataProvider
DataProviderjava.lang.Class<?> dataProviderClass
boolean alwaysRun
java.lang.String description
java.lang.Class[] expectedExceptions
java.lang.String expectedExceptionsMessageRegExp
java.lang.String suiteName
java.lang.String testName
boolean singleThreaded
java.lang.Class retryAnalyzer
boolean skipFailedInvocations