Class PropertyParameterGenerationContext
java.lang.Object
com.pholser.junit.quickcheck.internal.generator.AbstractGenerationStatus
com.pholser.junit.quickcheck.internal.generator.PropertyParameterGenerationContext
- All Implemented Interfaces:
GenerationStatus
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from interface com.pholser.junit.quickcheck.generator.GenerationStatus
GenerationStatus.Key<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final ConstraintEvaluatorprivate final Generator<?>private final PropertyParameterContextprivate final intprivate intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionPropertyParameterGenerationContext(PropertyParameterContext parameter, GeneratorRepository repository, GeometricDistribution distro, SourceOfRandomness random, ParameterSampler sampler) -
Method Summary
Modifier and TypeMethodDescriptionintattempts()longprivate booleangenerate()private static SourceOfRandomnessname()intvoidSignals part of an attempt to generate a value.intsize()private booleanMethods inherited from class com.pholser.junit.quickcheck.internal.generator.AbstractGenerationStatus
random, setValue, valueOf
-
Field Details
-
parameter
-
evaluator
-
generator
-
sampleSize
private final int sampleSize -
successfulEvaluations
private int successfulEvaluations -
discards
private int discards -
semiAttempts
private int semiAttempts
-
-
Constructor Details
-
PropertyParameterGenerationContext
public PropertyParameterGenerationContext(PropertyParameterContext parameter, GeneratorRepository repository, GeometricDistribution distro, SourceOfRandomness random, ParameterSampler sampler)
-
-
Method Details
-
initializeRandomness
private static SourceOfRandomness initializeRandomness(PropertyParameterContext p, SourceOfRandomness r) -
generate
-
shrink
-
evaluate
-
tooManyDiscards
private boolean tooManyDiscards() -
size
public int size()- Specified by:
sizein interfaceGenerationStatus- Overrides:
sizein classAbstractGenerationStatus- Returns:
- an arbitrary "size" parameter; this value (probabilistically) increases for every successful generation
-
attempts
public int attempts()- Returns:
- how many attempts have been made to generate a value for a property parameter
-
semiAttempt
public void semiAttempt()Description copied from interface:GenerationStatusSignals part of an attempt to generate a value.
Mostly for use by junit-quickcheck itself; generators can call this to convince the framework that it's doing work to generate a complex value, but doing so is not strictly necessary.
-
effectiveSeed
public long effectiveSeed() -
sampleSize
public int sampleSize() -
name
-
magnitude
-