@Test
public void testLSNInsertGroup() throws Exception {
// initialization
Random random = new Random();
long testSeed = RandomGenerator.getRandomSeed();
RandomGenerator testGen1 = new RandomGenerator();
RandomGenerator testGen2 = new RandomGenerator();
testGen1.initialize(testSeed);
testGen2.initialize(testSeed);
assert (RandomGenerator.MAX_SEQUENCENO<((long) Integer.MAX_VALUE)) : "This test cannot handle such a big MAX_SEQUENCENO.";
int viewID = random.nextInt(RandomGenerator.MAX_VIEWID-(RandomGenerator.MAX_VIEWID/2))+1;
long sequenceNO = random.nextInt((int) (RandomGenerator.MAX_SEQUENCENO-1L))+1L;
LSN testLSN = new LSN(viewID,sequenceNO);
for (int i=0;i<NO_TESTS_PER_CASE;i++){
assertEquals(testGen1.getInsertGroup(testLSN).toString(), testGen2.getInsertGroup(testLSN).toString());
if (sequenceNO<RandomGenerator.MAX_SEQUENCENO)
testLSN = new LSN(viewID,++sequenceNO);
else
testLSN = new LSN(++viewID,sequenceNO = 1L);
}