Top Description Fields Constructors Methods
org.eclipse.jgit.junit

public Class TestRng

extends Object
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public
TestRng(String
seed to bootstrap, usually this is the test method name.
seed
)

Create a new random number generator, seeded by a string.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

array of cnt randomly generated bytes.
nextBytes
(int
number of random bytes to produce.
cnt
)

Get the next cnt bytes of random data.

public int

Returns:

the next random integer.
nextInt
()

Next int

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextback to summary
private int next

Constructor Detail

TestRngback to summary
public TestRng(String seed)

Create a new random number generator, seeded by a string.

Parameters
seed:String

seed to bootstrap, usually this is the test method name.

Method Detail

nextBytesback to summary
public byte[] nextBytes(int cnt)

Get the next cnt bytes of random data.

Parameters
cnt:int

number of random bytes to produce.

Returns:byte[]

array of cnt randomly generated bytes.

nextIntback to summary
public int nextInt()

Next int

Returns:int

the next random integer.