ResourceManager rm = state.getResourceManager();
// Create a session
XASession sess1 = conn.createXASession();
MessagingXAResource res1 = (MessagingXAResource)sess1.getXAResource();
byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
int rmSizeBeforeStart = rm.size();
Xid xid = new MessagingXid(branchQualifier, 12435, globalTxId);
res1.start(xid, XAResource.TMNOFLAGS);
res1.end(xid, XAResource.TMSUCCESS);
int rmAfter = rm.size();
assertTrue(rmSizeBeforeStart + 1 == rmAfter);
res1.start(xid, XAResource.TMRESUME);
res1.end(xid, XAResource.TMSUCCESS);
rmAfter = rm.size();
assertTrue(rmSizeBeforeStart + 1 == rmAfter);
res1.commit(xid, true);
rmAfter = rm.size();
assertTrue(rmSizeBeforeStart == rmAfter);
}
finally
{