XASession session1 = conn1.createXASession();
XASession session2 = conn2.createXASession();
XASession session3 = conn3.createXASession();
AMQXAResource xaResource1 = (AMQXAResource)session1.getXAResource();
AMQXAResource xaResource2 = (AMQXAResource)session2.getXAResource();
AMQXAResource xaResource3 = (AMQXAResource)session3.getXAResource();
Xid xid = getNewXid();
xaResource1.start(xid, XAResource.TMNOFLAGS);
assertTrue("XAResource isSameRM", xaResource1.isSameRM(xaResource2));
xaResource2.start(xid, XAResource.TMJOIN);
assertTrue("AMQXAResource siblings should be 1", xaResource1.getSiblings().size() == 1);
assertTrue("AMQXAResource TMJOIN resource siblings should be 0", xaResource2.getSiblings().size() == 0);
assertTrue("XAResource isSameRM", xaResource2.isSameRM(xaResource3));
xaResource3.start(xid, XAResource.TMJOIN);
assertTrue("AMQXAResource siblings should be 1", xaResource2.getSiblings().size() == 1);
xaResource1.end(xid, XAResource.TMSUCCESS);
assertTrue("AMQXAResource TMJOIN resource siblings should be 0", xaResource1.getSiblings().size() == 0);