Package org.eclipse.jgit.junit
Class TestRng
java.lang.Object
org.eclipse.jgit.junit.TestRng
Toy RNG to ensure we get predictable numbers during unit tests.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
next
private int next
-
-
Constructor Details
-
TestRng
Create a new random number generator, seeded by a string.- Parameters:
seed
- seed to bootstrap, usually this is the test method name.
-
-
Method Details
-
nextBytes
public byte[] nextBytes(int cnt) Get the nextcnt
bytes of random data.- Parameters:
cnt
- number of random bytes to produce.- Returns:
- array of
cnt
randomly generated bytes.
-
nextInt
public int nextInt()Next int- Returns:
- the next random integer.
-