final TestSynchronization sync = new TestSynchronization();
t.registerSynchronization(sync);
final TestXAResource xaResource = new TestXAResource();
xaResource.setPrepareReturnValue(XAResource.XA_OK);
t.enlistResource(xaResource);
final XATerminator xaTerminator = SubordinationManager.getXATerminator();
assertEquals(XAResource.XA_OK, xaTerminator.prepare(xid));
xaTerminator.commit(xid, false);
assertTrue(sync.isBeforeCompletionDone());
assertTrue(sync.isAfterCompletionDone());
assertEquals(javax.transaction.Status.STATUS_COMMITTED, t.getStatus());
}