Assert.assertEquals(0, records.size());
Assert.assertEquals(0, transactions.size());
for (int i = 0; i < 10; i++)
{
journalImpl.appendAddRecordTransactional(1, i, (byte)1, new SimpleEncoding(50, (byte)1));
journalImpl.forceMoveNextFile();
}
journalImpl.debugWait();
SimpleEncoding xid1 = new SimpleEncoding(10, (byte)1);
journalImpl.appendPrepareRecord(1l, xid1, false);
Assert.assertEquals(12, factory.listFiles("tt").size());
setupAndLoadJournal(JOURNAL_SIZE, 1024);
Assert.assertEquals(0, records.size());
Assert.assertEquals(1, transactions.size());
Assert.assertEquals(10, transactions.get(0).extraData.length);
for (int i = 0; i < 10; i++)
{
Assert.assertEquals((byte)1, transactions.get(0).extraData[i]);
}
journalImpl.checkReclaimStatus();
Assert.assertEquals(10, journalImpl.getDataFilesCount());
Assert.assertEquals(12, factory.listFiles("tt").size());
journalImpl.appendCommitRecord(1l, false);
setupAndLoadJournal(JOURNAL_SIZE, 1024);
Assert.assertEquals(10, records.size());
journalImpl.checkReclaimStatus();
for (int i = 0; i < 10; i++)
{
journalImpl.appendDeleteRecordTransactional(2l, i);
}
SimpleEncoding xid2 = new SimpleEncoding(15, (byte)2);
journalImpl.appendPrepareRecord(2l, xid2, false);
setupAndLoadJournal(JOURNAL_SIZE, 1);