Class RandomConfiguration
- java.lang.Object
-
- de.cuioss.test.generator.internal.net.java.quickcheck.generator.distribution.RandomConfiguration
-
public final class RandomConfiguration extends Object
TheRandomConfigurationallows to get and set the seed of the random number generator.Setting the seed allows to run test deterministically with the same generated objects. The
setSeed(long)method can be used for that.An the other hand the
initSeed()method sets a new random seed and return it. This allows to generate random test objects in one run and repeat the same test by setting the seed withsetSeed(long).You can set the seed for the JVM with
SEED_SYSTEM_PROPERTY. This system property will be evaluated at start up. CallingsetSeed(long)will overwrite this setting.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSEED_SYSTEM_PROPERTYSystem property (SEED_SYSTEM_PROPERTY) to set thelongseed value for the random number generator.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetLastSeed()static longinitSeed()static voidsetSeed(long seed)
-
-
-
Field Detail
-
SEED_SYSTEM_PROPERTY
public static final String SEED_SYSTEM_PROPERTY
System property (SEED_SYSTEM_PROPERTY) to set thelongseed value for the random number generator.Note: The actual values generated by the RNG still depend on the execution order. That may be not under the control of quickcheck.
- See Also:
- Constant Field Values
-
-
Method Detail
-
initSeed
public static long initSeed()
-
setSeed
public static void setSeed(long seed)
-
getLastSeed
public static long getLastSeed()
-
-