@Retention(value=RUNTIME) public @interface Parameters
| Modifier and Type | Optional Element and Description |
|---|---|
String |
method
Parameter values returned by a method within the test class.
|
String |
named
Alternative way to designate a method providing parameters for test.
|
Class<?> |
source
Parameter values defined externally.
|
String[] |
value
Parameter values defined as a String array.
|
public abstract String[] value
Example: @Parameters({
"1, joe, 26.4, true",
"2, angie, 37.2, false"})
public abstract Class<?> source
provide
returning Object[]. All such methods are used, so you can
group your examples. The resulting array should contain parameter sets in
its elements. Each parameter set must be another Object[] array, which
contains parameter values in its elements.
Example: @Parameters(source = PeopleProvider.class)public abstract String method
@Parameters(method = "exemplaryPeople")
You can use multiple methods to provide parameters - use comma to do it:
Example: @Parameters(method = "womenParams, menParams")
public abstract String named
@NamedParameters.
This way you can rely on method description instead of name.
Example:
@Parameters(named = "exemplaryPeople")
You can use multiple named methods to provide parameters - use comma to do it:
@Parameters(named = "womenParams, menParams")
NamedParametersCopyright © 2017 Pragmatists. All rights reserved.