org.eclipse.jgit.junit
Class TestRng

java.lang.Object
  extended by org.eclipse.jgit.junit.TestRng

public class TestRng
extends java.lang.Object

Toy RNG to ensure we get predictable numbers during unit tests.


Constructor Summary
TestRng(java.lang.String seed)
          Create a new random number generator, seeded by a string.
 
Method Summary
 byte[] nextBytes(int cnt)
          Get the next cnt bytes of random data.
 int nextInt()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRng

public TestRng(java.lang.String seed)
Create a new random number generator, seeded by a string.

Parameters:
seed - seed to bootstrap, usually this is the test method name.
Method Detail

nextBytes

public byte[] nextBytes(int cnt)
Get the next cnt bytes of random data.

Parameters:
cnt - number of random bytes to produce.
Returns:
array of cnt randomly generated bytes.

nextInt

public int nextInt()
Returns:
the next random integer.


Copyright © 2011. All Rights Reserved.