@Test
public void testCheckpoint() throws Exception {
// ����1
final LocalTransactionId xid1 = new LocalTransactionId("session1", 1);
final MessageStore store1 = this.messageStoreManager.getOrCreateMessageStore("topic1", 2);
this.transactionStore.addMessage(store1, 1, new PutCommand("topic1", 2, ("msg" + 2).getBytes(), xid1, 0, 1),
null);
// ����2
final LocalTransactionId xid2 = new LocalTransactionId("session2", 1);
final MessageStore store2 = this.messageStoreManager.getOrCreateMessageStore("topic1", 3);
this.transactionStore.addMessage(store2, 1, new PutCommand("topic1", 3, ("msg" + 3).getBytes(), xid2, 0, 1),
null);
// ����3���Ѿ��ύ
final LocalTransactionId xid3 = new LocalTransactionId("session3", 1);
final MessageStore store3 = this.messageStoreManager.getOrCreateMessageStore("topic1", 0);
this.transactionStore.addMessage(store3, 1, new PutCommand("topic1", 0, ("msg" + 0).getBytes(), xid3, 0, 1),
null);
this.transactionStore.commit(xid3, false);
// ����checkpoint��Ӧ��Ϊ����1
final JournalLocation location = this.transactionStore.checkpoint();