use of com.hp.mwtests.ts.jta.common.SampleOnePhaseResource in project narayana by jbosstm.
the class ForgetTest method testCommitHeuristic.
@Test
public void testCommitHeuristic() {
SampleOnePhaseResource res = new SampleOnePhaseResource(SampleOnePhaseResource.ErrorType.heurcom);
XidImple xid = new XidImple(new Uid());
XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
assertTrue(res.forgetCalled());
}
use of com.hp.mwtests.ts.jta.common.SampleOnePhaseResource in project narayana by jbosstm.
the class OnePhaseUnitTest method testCommitHeuristic.
@Test
public void testCommitHeuristic() {
SampleOnePhaseResource res = new SampleOnePhaseResource(ErrorType.heurcom);
XidImple xid = new XidImple(new Uid());
XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
assertTrue(res.forgetCalled());
}
use of com.hp.mwtests.ts.jta.common.SampleOnePhaseResource in project narayana by jbosstm.
the class OnePhaseUnitTest method testRollbackHeuristic.
@Test
public void testRollbackHeuristic() {
SampleOnePhaseResource res = new SampleOnePhaseResource(ErrorType.heurrb);
XidImple xid = new XidImple(new Uid());
XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
assertTrue(res.forgetCalled());
}
Aggregations