Class RandomConfiguration


  • public final class RandomConfiguration
    extends Object
    The RandomConfiguration allows 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 with setSeed(long).

    You can set the seed for the JVM with SEED_SYSTEM_PROPERTY. This system property will be evaluated at start up. Calling setSeed(long) will overwrite this setting.

    • Field Detail

      • SEED_SYSTEM_PROPERTY

        public static final String SEED_SYSTEM_PROPERTY
        System property (SEED_SYSTEM_PROPERTY) to set the long seed 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)