|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pholser.junit.quickcheck.generator.Generator<Object>
com.pholser.junit.quickcheck.internal.generator.CompositeGenerator
public class CompositeGenerator
| Constructor Summary | |
|---|---|
CompositeGenerator(List<Generator<?>> components)
|
|
| Method Summary | |
|---|---|
Generator<?> |
componentGenerator(int index)
|
void |
configure(Map<Class<? extends Annotation>,Annotation> configurationsByType)
Tells this generator to configure itself using annotations from a theory parameter. |
Object |
generate(SourceOfRandomness random,
GenerationStatus status)
Produces a value for a theory parameter. |
int |
numberOfComponentGenerators()
|
| Methods inherited from class com.pholser.junit.quickcheck.generator.Generator |
|---|
addComponentGenerators, canGenerateForParametersOfTypes, canRegisterAsType, compatibleWithTypeParameter, hasComponents, numberOfNeededComponents, types |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeGenerator(List<Generator<?>> components)
| Method Detail |
|---|
public Object generate(SourceOfRandomness random,
GenerationStatus status)
GeneratorProduces a value for a theory parameter.
A generator may raise an unchecked exception if some condition exists which would lead to a confusing generation -- for example, if a generator honored a range configuration, and the endpoints were transposed.
generate in class Generator<Object>random - a source of randomness to be used when generating the valuestatus - an object that the generator can use to influence the value it produces. For example, a generator
for lists can use the size method to generate lists with a given number of
elements.
public Generator<?> componentGenerator(int index)
public int numberOfComponentGenerators()
public void configure(Map<Class<? extends Annotation>,Annotation> configurationsByType)
GeneratorTells this generator to configure itself using annotations from a theory parameter.
The annotations fed to this method will be those annotations on the theory parameter that are themselves
marked with GeneratorConfiguration.
By default, the generator will configure itself by:
public method on the generator named configure, that accepts a single
parameter of the annotation typeconfigure method reflectively, passing the annotation as the argument
configure in class Generator<Object>configurationsByType - a map of configuration annotations, keyed by annotation type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||