final TestSynchronization sync = new TestSynchronization();
tm.registerSynchronization(sync);
final TestXAResource xaResource = new TestXAResource();
xaResource.setPrepareReturnValue(XAResource.XA_OK);
tm.enlistResource(xaResource);
assertEquals(TwoPhaseOutcome.PREPARE_OK, tm.doPrepare());
tm.doCommit();
assertTrue(sync.isBeforeCompletionDone());
assertTrue(sync.isAfterCompletionDone());
assertEquals(javax.transaction.Status.STATUS_COMMITTED, tm.getStatus());
}