@Target(value={PARAMETER,FIELD,ANNOTATION_TYPE,TYPE_USE}) @Retention(value=RUNTIME) public @interface Only
Mark a parameter of a Property method with this annotation to
limit the set of values of that parameter used to test the property.
In sampling mode, on each trial junit-quickcheck chooses a value from the limited set at random with equal probability.
In exhaustive mode, junit-quickcheck will use the values in the limited set for the property parameter, and no others.
Note: When a parameter is marked with this annotation, junit-quickcheck doesn't call upon any generators. Thus, it ignores any generator configuration annotations present on the parameter.
| Modifier and Type | Required Element and Description |
|---|---|
String[] |
value |
| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends StringConversion> |
by
How to convert the values in
value() into instances of the
property parameter's type. |
public abstract String[] value
public abstract Class<? extends StringConversion> by
How to convert the values in value() into instances of the
property parameter's type.
If not specified, junit-quickcheck employs the following strategies for value conversion for the marked parameter:
public static method on the property
parameter type called valueOf which accepts a single
String argument and whose return type is the type itself.public constructor on the
property parameter type which accepts a single String
argument.Copyright © 2019. All rights reserved.