assertTrue(tr2.timestamp > tr1.timestamp);
//
// Test Commit query of uncommitted transaction
//
clientHandler.sendMessage(new CommitQueryRequest(tr2.timestamp, tr1.timestamp));
CommitQueryResponse cqr1 = clientHandler.receiveMessage(CommitQueryResponse.class);
assertFalse(cqr1.committed);
assertFalse(cqr1.retry);
clientHandler.sendMessage(new CommitRequest(tr1.timestamp, new RowKey[] { r1 }));
CommitResponse cr1 = clientHandler.receiveMessage(CommitResponse.class);
assertTrue(cr1.committed);
assertTrue(cr1.commitTimestamp > tr1.timestamp);
assertEquals(tr1.timestamp, cr1.startTimestamp);
//
// Test Commit query of concurrent committed transaction
//
clientHandler.sendMessage(new CommitQueryRequest(tr2.timestamp, tr1.timestamp));
CommitQueryResponse cqr2 = clientHandler.receiveMessage(CommitQueryResponse.class);
assertFalse(cqr2.committed);
assertFalse(cqr2.retry);
clientHandler.sendMessage(new CommitRequest(tr2.timestamp, new RowKey[] { r1, r2 }));
CommitResponse cr2 = clientHandler.receiveMessage(CommitResponse.class);
assertFalse(cr2.committed);
// Queued reports
clientHandler.sendMessage(new TimestampRequest());
clientHandler.receiveMessage(CommittedTransactionReport.class);
clientHandler.receiveMessage(AbortedTransactionReport.class);
TimestampResponse tr3 = clientHandler.receiveMessage(TimestampResponse.class);
assertTrue(tr3.timestamp > tr2.timestamp);
state.largestDeletedTimestamp = 1000000;
//
// Test Commit query of half aborted transaction
//
clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr2.timestamp));
CommitQueryResponse cqr3 = clientHandler.receiveMessage(CommitQueryResponse.class);
assertFalse(cqr3.committed);
assertFalse(cqr3.retry);
clientHandler.sendMessage(new FullAbortRequest(tr2.timestamp));
//
// Test Commit query of full aborted transaction
//
clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr2.timestamp));
CommitQueryResponse cqr4 = clientHandler.receiveMessage(CommitQueryResponse.class);
assertFalse(cqr4.committed);
assertTrue(cqr4.retry);
//
// Test Commit query of committed transaction
//
clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr1.timestamp));
CommitQueryResponse cqr5 = clientHandler.receiveMessage(CommitQueryResponse.class);
assertTrue(cqr5.committed);
assertFalse(cqr5.retry);
}