|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.quickcheck.QuickCheck
public class QuickCheck
QuickCheck is an implementation of the Haskell QuickCheck generator based test tool (http://www.cs.chalmers.se/~rjmh/QuickCheck/).
Field Summary | |
---|---|
static int |
MAX_NUMBER_OF_RUNS
|
static int |
MIN_NUMBER_OF_RUNS
|
static String |
SYSTEM_PROPERTY_RUNS
|
Constructor Summary | |
---|---|
QuickCheck()
|
Method Summary | ||
---|---|---|
static
|
forAll(Generator<T> generator,
Characteristic<T> characteristic)
Check the Characteristic for all values generated by the given
Generator . |
|
static
|
forAll(int runs,
Generator<T> generator,
Characteristic<T> characteristic)
Check the Characteristic for all values generated by the given
Generator . |
|
static
|
forAllVerbose(Generator<T> generator,
Characteristic<T> characteristic)
Check the Characteristic for all values generated by the given
Generator . |
|
static
|
forAllVerbose(int runs,
Generator<T> generator,
Characteristic<T> characteristic)
Check the Characteristic for all values generated by the given
Generator . |
|
static int |
getDefaultNumberOfRuns()
|
|
static void |
guard(boolean predicate)
All executions of Characteristic.specify(Object) which execute
guard(boolean) will be skipped and a new test case
will be generated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_NUMBER_OF_RUNS
public static final int MIN_NUMBER_OF_RUNS
public static final String SYSTEM_PROPERTY_RUNS
Constructor Detail |
---|
public QuickCheck()
Method Detail |
---|
public static <T> void forAll(Generator<T> generator, Characteristic<T> characteristic) throws GeneratorException, CharacteristicException
Characteristic
for all values generated by the given
Generator
. The execution will fail fast if any of the calls of
the Characteristic.specify(Object)
method throws an exception.
T
- type of the generated values
CharacteristicException
- if a characteristic is not true
for a generated
value
GeneratorException
- if generation of the next value failed.public static int getDefaultNumberOfRuns()
public static <T> void forAll(int runs, Generator<T> generator, Characteristic<T> characteristic) throws GeneratorException, CharacteristicException
Characteristic
for all values generated by the given
Generator
. The execution will fail fast if any of the calls of
the Characteristic.specify(Object)
method throws an exception.
T
- type of the generated valuesruns
- number of runs and generated values for this characteristic
CharacteristicException
- if a characteristic is not true
for a generated
value
GeneratorException
- if generation of the next value failed.public static <T> void forAllVerbose(Generator<T> generator, Characteristic<T> characteristic) throws GeneratorException, CharacteristicException
Characteristic
for all values generated by the given
Generator
. The execution will fail fast if any of the calls of
the Characteristic.specify(Object)
method throws an exception.
T
- type of the generated values
CharacteristicException
- if a characteristic is not true
for a generated
value
GeneratorException
- if generation of the next value failed.public static <T> void forAllVerbose(int runs, Generator<T> generator, Characteristic<T> characteristic) throws GeneratorException, CharacteristicException
Characteristic
for all values generated by the given
Generator
. The execution will fail fast if any of the calls of
the Characteristic.specify(Object)
method throws an exception.
T
- type of the generated valuesruns
- number of runs and generated values for this characteristic
CharacteristicException
- if a characteristic is not true
for a generated
value
GeneratorException
- if generation of the next value failed.public static void guard(boolean predicate)
Characteristic.specify(Object)
which execute
guard(boolean)
will be skipped and a new test case
will be generated. Execution will be stopped if it is not possible to
create a new test cases after a reasonable amount of tries.
predicate
- Skip the current test case if the predicate is true.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |