net.java.quickcheck.junit
Class SeedInfo

java.lang.Object
  extended by net.java.quickcheck.junit.SeedInfo
All Implemented Interfaces:
org.junit.rules.MethodRule

public class SeedInfo
extends Object
implements org.junit.rules.MethodRule

SeedInfo adds information about the seed used by the random number.

The information is added to the AssertionError thrown for failed tests.

You can used the restore(long) method to rerun a test with the same seed.

Alternatively you can use RandomConfiguration directly in your tests.


Constructor Summary
SeedInfo()
           
 
Method Summary
 org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod frameworkMethod, Object target)
           
 void restore(long seed)
          Set the seed to a value logged before.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeedInfo

public SeedInfo()
Method Detail

restore

public void restore(long seed)
Set the seed to a value logged before.


apply

public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
                                               org.junit.runners.model.FrameworkMethod frameworkMethod,
                                               Object target)
Specified by:
apply in interface org.junit.rules.MethodRule


Copyright © 2011. All Rights Reserved.