Package net.jqwik.api
Annotation Type Property
-
@Target({METHOD,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented @Testable @API(status=STABLE, since="1.0") public @interface Property
Use@Property
to mark methods that serve as properties. Those methods usually have one or more parameters annotated with ForAll.They are executed (tried) several times, either until they fail or until the configured number of
tries()
has been reached.Just like methods annotated with Example example, annotated methods must not be private. They can either return
Boolean
,boolean
orvoid
.For more info, you can have a look at the user guide, optional-property-parameters.
- See Also:
Example
,ShrinkingMode
,GenerationMode
,AfterFailureMode
,EdgeCasesMode
,Data
-
-
Field Summary
Fields Modifier and Type Fields Description static int
MAX_DISCARD_RATIO_NOT_SET
static java.lang.String
SEED_NOT_SET
static java.lang.String
STEREOTYPE_NOT_SET
static int
TRIES_NOT_SET
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description AfterFailureMode
afterFailure
EdgeCasesMode
edgeCases
GenerationMode
generation
int
maxDiscardRatio
The maximum ratio of tried versus actually checked property runs in case you are using Assumptions.java.lang.String
seed
ShrinkingMode
shrinking
Controls how shrinking is done when falsified property is found.java.lang.String
stereotype
int
tries
Tries are the test runs with different parameters.FixedSeedMode
whenFixedSeed
Controls how to behave if aseed()
is present.
-
-
-
Element Detail
-
tries
int tries
Tries are the test runs with different parameters. By default it is 1000. You can override globally in the property file (see jqwik.properties, or here, inProperty
annotation.- Returns:
- number of tries to run
- Default:
- 0
-
-
-
maxDiscardRatio
int maxDiscardRatio
The maximum ratio of tried versus actually checked property runs in case you are using Assumptions. If the ratio is exceeded jqwik will report this property as a failure.The default is 5 which can be overridden in jqwik.properties.
- Returns:
- the maximum ration
- Default:
- 0
-
-
-
shrinking
ShrinkingMode shrinking
Controls how shrinking is done when falsified property is found.Default value is
ShrinkingMode.BOUNDED
, i.e. shrinking is tried to a depth of 1000 steps maximum per value.- Returns:
- the shrinking mode
- Default:
- net.jqwik.api.ShrinkingMode.NOT_SET
-
-
-
generation
@API(status=MAINTAINED, since="1.0") GenerationMode generation
- Default:
- net.jqwik.api.GenerationMode.NOT_SET
-
-
-
afterFailure
@API(status=MAINTAINED, since="1.0") AfterFailureMode afterFailure
- Default:
- net.jqwik.api.AfterFailureMode.NOT_SET
-
-
-
edgeCases
@API(status=EXPERIMENTAL, since="1.3.0") EdgeCasesMode edgeCases
- Default:
- net.jqwik.api.EdgeCasesMode.NOT_SET
-
-
-
whenFixedSeed
@API(status=EXPERIMENTAL, since="1.4.0") FixedSeedMode whenFixedSeed
Controls how to behave if aseed()
is present.Default value is the value from the global
jqwik.seeds.whenfixed
configuration property.- Returns:
- the fixed seed mode
- Default:
- net.jqwik.api.FixedSeedMode.NOT_SET
-
-