Interface PropertyExecutionResult


@API(status=MAINTAINED, since="1.4.0") public interface PropertyExecutionResult
Represents the result of running a property.
  • Method Details

    • seed

      Optional<String> seed()
      The seed used to generate randomized parameters.
      Returns:
      an optional String
    • falsifiedParameters

      Optional<List<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

      The final status of this property
      Returns:
      status enum
    • throwable

      Optional<Throwable> throwable()
      Will return Optional.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") 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") 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 Throwable throwable)
      Use to change the status of a property execution result in a AroundPropertyHook.
      Parameters:
      newStatus - Status enum
      throwable - 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 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(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 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