Package net.jqwik.api.lifecycle
Interface PropertyExecutionResult
@API(status=MAINTAINED,
since="1.4.0")
public interface PropertyExecutionResult
Represents the result of running a property.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Status of executing a single test or container. -
Method Summary
Modifier and TypeMethodDescriptionint
The number of tries for which parameters were created and the property method run.int
The number of tries for which parameters were created and the property method run and which were not aborted, e.g. through a failing assumption.The potentially shrunk list of parameters that falsified this property.mapTo
(PropertyExecutionResult.Status newStatus, Throwable throwable) Use to change the status of a property execution result in a AroundPropertyHook.default PropertyExecutionResult
mapToAborted
(Throwable throwable) Use to change the status of a property execution to PropertyExecutionResult.Status.ABORTED in a AroundPropertyHook.default PropertyExecutionResult
mapToFailed
(String message) Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.default PropertyExecutionResult
mapToFailed
(Throwable throwable) Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.default PropertyExecutionResult
Use to change the status of a failed property to PropertyExecutionResult.Status.SUCCESSFUL in a AroundPropertyHook.Return the original falsified sample if there was one.seed()
The seed used to generate randomized parameters.Return the shrunk falsified sample if successful shrinking took place.status()
The final status of this propertyWill returnOptional.empty()
if status is anything but FAILED.
-
Method Details
-
seed
The seed used to generate randomized parameters.- Returns:
- an optional String
-
falsifiedParameters
The potentially shrunk list of parameters that falsified this property.The parameter list returned contains the actual parameters used during the property run. If one or more parameters were changed during the run, this change is visible here.
- Returns:
- an optional list of parameters
-
status
PropertyExecutionResult.Status status()The final status of this property- Returns:
- status enum
-
throwable
Will returnOptional.empty()
if status is anything but FAILED. If FAILED the optional MUST contain a throwable. -
countChecks
int countChecks()The number of tries for which parameters were created and the property method run.- Returns:
- an number equal to or greater than 0
-
countTries
int countTries()The number of tries for which parameters were created and the property method run and which were not aborted, e.g. through a failing assumption.- Returns:
- an number equal to or greater than 0
-
originalSample
Return the original falsified sample if there was one.- Returns:
- an optional falsified sample
-
shrunkSample
Return the shrunk falsified sample if successful shrinking took place.- Returns:
- an optional falsified sample
-
mapTo
PropertyExecutionResult mapTo(PropertyExecutionResult.Status newStatus, @Nullable Throwable throwable) Use to change the status of a property execution result in a AroundPropertyHook.- Parameters:
newStatus
- Status enumthrowable
- Throwable object or null- Returns:
- the changed result object
-
mapToSuccessful
Use to change the status of a failed property to PropertyExecutionResult.Status.SUCCESSFUL in a AroundPropertyHook.- Returns:
- the changed result object
-
mapToFailed
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.- Parameters:
throwable
- Throwable object or null- Returns:
- the changed result object
-
mapToFailed
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.- Parameters:
message
- a String that serves as message of an assertion error- Returns:
- the changed result object
-
mapToAborted
Use to change the status of a property execution to PropertyExecutionResult.Status.ABORTED in a AroundPropertyHook.- Parameters:
throwable
- Throwable object or null- Returns:
- the changed result object
-