Search in sources :

Example 6 with SampleOnePhaseResource

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());
}
Also used : XidImple(com.arjuna.ats.jta.xa.XidImple) Uid(com.arjuna.ats.arjuna.common.Uid) XAOnePhaseResource(com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource) SampleOnePhaseResource(com.hp.mwtests.ts.jta.common.SampleOnePhaseResource) Test(org.junit.Test)

Example 7 with SampleOnePhaseResource

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());
}
Also used : XidImple(com.arjuna.ats.jta.xa.XidImple) Uid(com.arjuna.ats.arjuna.common.Uid) XAOnePhaseResource(com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource) SampleOnePhaseResource(com.hp.mwtests.ts.jta.common.SampleOnePhaseResource) Test(org.junit.Test)

Example 8 with SampleOnePhaseResource

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());
}
Also used : XidImple(com.arjuna.ats.jta.xa.XidImple) Uid(com.arjuna.ats.arjuna.common.Uid) XAOnePhaseResource(com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource) SampleOnePhaseResource(com.hp.mwtests.ts.jta.common.SampleOnePhaseResource) Test(org.junit.Test)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)8 XAOnePhaseResource (com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource)8 XidImple (com.arjuna.ats.jta.xa.XidImple)8 SampleOnePhaseResource (com.hp.mwtests.ts.jta.common.SampleOnePhaseResource)8 Test (org.junit.Test)8 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)2 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)1 DummyRecoverableXAConnection (com.hp.mwtests.ts.jta.common.DummyRecoverableXAConnection)1 IOException (java.io.IOException)1