use of com.arjuna.ats.internal.jta.xa.XID in project narayana by jbosstm.
the class CommitMarkableResourceRecordBean method init.
private void init() {
jndiName = getUid().stringForm();
className = "unavailable";
eisProductName = "unavailable";
eisProductVersion = "unavailable";
timeout = 0;
heuristic = -1;
xidImple = new XidImple(new XID());
}
use of com.arjuna.ats.internal.jta.xa.XID in project narayana by jbosstm.
the class UtilsUnitTest method testXAHelper.
@Test
public void testXAHelper() throws Exception {
assertTrue(XAHelper.printXAErrorCode(null) != null);
XAException ex = new XAException(XAException.XA_HEURCOM);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_HEURCOM");
ex = new XAException(XAException.XA_HEURHAZ);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_HEURHAZ");
ex = new XAException(XAException.XA_HEURMIX);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_HEURMIX");
ex = new XAException(XAException.XA_HEURRB);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_HEURRB");
ex = new XAException(XAException.XA_NOMIGRATE);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_NOMIGRATE");
ex = new XAException(XAException.XA_RBCOMMFAIL);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBCOMMFAIL");
ex = new XAException(XAException.XA_RBDEADLOCK);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBDEADLOCK");
ex = new XAException(XAException.XA_RBINTEGRITY);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBINTEGRITY");
ex = new XAException(XAException.XA_RBOTHER);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBOTHER");
ex = new XAException(XAException.XA_RBPROTO);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBPROTO");
ex = new XAException(XAException.XA_RBROLLBACK);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBROLLBACK");
ex = new XAException(XAException.XA_RBTIMEOUT);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBTIMEOUT");
ex = new XAException(XAException.XA_RBTRANSIENT);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RBTRANSIENT");
ex = new XAException(XAException.XA_RDONLY);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RDONLY");
ex = new XAException(XAException.XA_RETRY);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XA_RETRY");
ex = new XAException(XAException.XAER_RMERR);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_RMERR");
ex = new XAException(XAException.XAER_ASYNC);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_ASYNC");
ex = new XAException(XAException.XAER_DUPID);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_DUPID");
ex = new XAException(XAException.XAER_INVAL);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_INVAL");
ex = new XAException(XAException.XAER_NOTA);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_NOTA");
ex = new XAException(XAException.XAER_OUTSIDE);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_OUTSIDE");
ex = new XAException(XAException.XAER_PROTO);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_PROTO");
ex = new XAException(XAException.XAER_RMFAIL);
assertEquals(XAHelper.printXAErrorCode(ex), "XAException.XAER_RMFAIL");
assertTrue(XAHelper.printXAErrorCode(new XAException(-1)) != null);
XidImple xid1 = new XidImple(new Uid());
XidImple xid2 = new XidImple(new Uid());
XidImple xid3 = new XidImple(xid1);
assertFalse(XAHelper.sameXID(xid1, xid2));
assertTrue(XAHelper.sameXID(xid1, xid3));
assertTrue(XAHelper.sameTransaction(xid1, xid1));
assertTrue(XAHelper.sameTransaction(xid1, xid3));
assertTrue(XAHelper.xidToString(xid1) != null);
XID x = new XID();
x.bqual_length = 1;
x.gtrid_length = 1;
x.data = new byte[] { '1', '2' };
assertTrue(x.toString() != null);
XAHelper.xidToString(new DummyXid());
}
use of com.arjuna.ats.internal.jta.xa.XID in project narayana by jbosstm.
the class xidcheck method testBasic.
@Test
public void testBasic() {
XidImple xid1 = new XidImple();
AtomicAction A = new AtomicAction();
assertEquals(xid1.getFormatId(), -1);
xid1 = new XidImple(A);
XidImple xid2 = new XidImple(new Uid());
assertFalse(xid1.isSameTransaction(xid2));
XidImple xid3 = new XidImple(xid1);
assertTrue(xid3.isSameTransaction(xid1));
assertTrue(xid1.getFormatId() != -1);
assertTrue(xid1.getBranchQualifier().length > 0);
assertTrue(xid1.getGlobalTransactionId().length > 0);
assertEquals(xid1.getTransactionUid(), A.get_uid());
assertTrue(XATxConverter.getNodeName(xid1.getXID()).equals(TxControl.getXANodeName()));
assertTrue(xid1.getXID() != null);
assertTrue(xid1.equals(xid3));
XID x = new XID();
assertFalse(xid1.equals(x));
xid1 = new XidImple(x);
}
Aggregations