use of com.arjuna.ats.jta.xa.XidImple in project narayana by jbosstm.
the class OnePhaseUnitTest method test.
@Test
public void test() throws Exception {
DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection();
Object[] obj = new Object[1];
SampleOnePhaseResource res = new SampleOnePhaseResource();
obj[XAResourceRecord.XACONNECTION] = rc;
XAOnePhaseResource xares = new XAOnePhaseResource(res, new XidImple(new Uid()), obj);
OutputObjectState os = new OutputObjectState();
xares.pack(os);
InputObjectState is = new InputObjectState(os);
xares.unpack(is);
}
use of com.arjuna.ats.jta.xa.XidImple in project narayana by jbosstm.
the class OnePhaseUnitTest method testCommit.
@Test
public void testCommit() {
SampleOnePhaseResource res = new SampleOnePhaseResource();
XidImple xid = new XidImple(new Uid());
XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
assertTrue(res.onePhaseCalled());
}
use of com.arjuna.ats.jta.xa.XidImple in project narayana by jbosstm.
the class xidcheck method test.
@Test
public void test() {
Uid test = new Uid();
XidImple xidImple = new XidImple(test, true, null);
System.err.println("Uid is: " + test);
System.err.println("Xid is: " + xidImple);
Uid convertedUid = xidImple.getTransactionUid();
assertEquals(test, convertedUid);
}
use of com.arjuna.ats.jta.xa.XidImple in project narayana by jbosstm.
the class TxInfoUnitTest method test.
@Test
public void test() {
TxInfo tx = new TxInfo(new XidImple(new Uid()));
tx.setState(-1);
assertEquals(tx.getState(), TxInfo.UNKNOWN);
}
use of com.arjuna.ats.jta.xa.XidImple in project narayana by jbosstm.
the class RecoveryTest method test.
@Test
public void test() {
Vector xaRecoveryNodes = new Vector();
xaRecoveryNodes.add("2");
System.err.println("Bogus XA node name: " + "2");
XidImple xid = new XidImple(new Uid());
String nodeName = XAUtils.getXANodeName(xid);
// should fail.
System.err.println("XA node name: " + nodeName);
System.err.println("Xid to recover: " + xid);
assertFalse(xaRecoveryNodes.contains(nodeName));
}
Aggregations