use of com.hp.mwtests.ts.jta.common.FailureXAResource in project narayana by jbosstm.
the class XAResourceRecordUnitTest method testCommitFailure.
@Test
public void testCommitFailure() throws Exception {
ThreadActionData.purgeActions();
OTSImpleManager.current().contextManager().purgeActions();
FailureXAResource fxa = new FailureXAResource(FailureXAResource.FailLocation.commit);
TransactionImple tx = new TransactionImple();
XAResourceRecord xares = new XAResourceRecord(tx, fxa, tx.getTxId(), null);
assertEquals(xares.prepare(), Vote.VoteCommit);
try {
xares.commit();
fail();
} catch (final HeuristicMixed ex) {
}
xares.forget();
}
Aggregations