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
Nested Classes Modifier and Type Interface Description static class
PropertyExecutionResult.Status
Status of executing a single test or container.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
countChecks()
The number of tries for which parameters were created and the property method run.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.java.util.Optional<java.util.List<java.lang.Object>>
falsifiedParameters()
The potentially shrunk list of parameters that falsified this property.PropertyExecutionResult
mapTo(PropertyExecutionResult.Status newStatus, java.lang.Throwable throwable)
Use to change the status of a property execution result in a AroundPropertyHook.default PropertyExecutionResult
mapToAborted(java.lang.Throwable throwable)
Use to change the status of a property execution to PropertyExecutionResult.Status.ABORTED in a AroundPropertyHook.default PropertyExecutionResult
mapToFailed(java.lang.String message)
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.default PropertyExecutionResult
mapToFailed(java.lang.Throwable throwable)
Use to change the status of a successful property execution to PropertyExecutionResult.Status.FAILED in a AroundPropertyHook.default PropertyExecutionResult
mapToSuccessful()
Use to change the status of a failed property to PropertyExecutionResult.Status.SUCCESSFUL in a AroundPropertyHook.java.util.Optional<FalsifiedSample>
originalSample()
Return the original falsified sample if there was one.java.util.Optional<java.lang.String>
seed()
The seed used to generate randomized parameters.java.util.Optional<ShrunkFalsifiedSample>
shrunkSample()
Return the shrunk falsified sample if successful shrinking took place.PropertyExecutionResult.Status
status()
The final status of this propertyjava.util.Optional<java.lang.Throwable>
throwable()
Will returnOptional.empty()
if status is anything but FAILED.
-
-
-
Method Detail
-
seed
java.util.Optional<java.lang.String> seed()
The seed used to generate randomized parameters.- Returns:
- an optional String
-
falsifiedParameters
java.util.Optional<java.util.List<java.lang.Object>> 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
java.util.Optional<java.lang.Throwable> 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
@API(status=MAINTAINED, since="1.3.5") java.util.Optional<FalsifiedSample> originalSample()
Return the original falsified sample if there was one.- Returns:
- an optional falsified sample
-
shrunkSample
@API(status=MAINTAINED, since="1.3.5") java.util.Optional<ShrunkFalsifiedSample> shrunkSample()
Return the shrunk falsified sample if successful shrinking took place.- Returns:
- an optional falsified sample
-
mapTo
PropertyExecutionResult mapTo(PropertyExecutionResult.Status newStatus, @Nullable java.lang.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
default PropertyExecutionResult mapToSuccessful()
Use to change the status of a failed property to PropertyExecutionResult.Status.SUCCESSFUL in a AroundPropertyHook.- Returns:
- the changed result object
-
mapToFailed
default PropertyExecutionResult mapToFailed(@Nullable java.lang.Throwable throwable)
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
default PropertyExecutionResult mapToFailed(java.lang.String message)
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
default PropertyExecutionResult mapToAborted(@Nullable java.lang.Throwable throwable)
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
-
-