assertNull(mark);
}
public void testAppendAndRead() throws InvalidRecordLocationException, InterruptedException, IOException {
byte data1[] = "Hello World 1".getBytes();
RecordLocation location1 = journal.write( data1, false);
byte data2[] = "Hello World 2".getBytes();
RecordLocation location2 = journal.write( data2, false);
byte data3[] = "Hello World 3".getBytes();
RecordLocation location3 = journal.write( data3, false);
// Now see if we can read that data.
byte[] data;
data = journal.read(location2);
assertEquals( data2, data);
data = journal.read(location1);
assertEquals( data1, data);
data = journal.read(location3);
assertEquals( data3, data);
// Can we cursor the data?
RecordLocation l=journal.getNextRecordLocation(null);
assertEquals(0, l.compareTo(location1));
data = journal.read(l);
assertEquals( data1, data);
l=journal.getNextRecordLocation(l);
assertEquals(0, l.compareTo(location2));
data = journal.read(l);
assertEquals( data2, data);
l=journal.getNextRecordLocation(l);
assertEquals(0, l.compareTo(location3));
data = journal.read(l);
assertEquals( data3, data);
l=journal.getNextRecordLocation(l);
assertNull(l);