Annotation 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.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    How to convert the values in value() into instances of the property parameter's type.
  • Element Details

    • value

      String[] value
      Returns:
      the values to which the property parameter should be limited
    • by

      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:

      • If present, use a public static method on the property parameter type called valueOf which accepts a single String argument and whose return type is the type itself.
      • Otherwise, if present, use a public constructor on the property parameter type which accepts a single String argument.
      Returns:
      a type for a value conversion strategy
      Default:
      com.pholser.junit.quickcheck.conversion.StringConversion.class