Search in sources :

Example 26 with TxSupport

use of org.jboss.jbossts.star.util.TxSupport in project wildfly by wildfly.

the class CoordinatorTestCase method test1PCAbort.

@Test
public void test1PCAbort() throws Exception {
    TxSupport txn = new TxSupport();
    String pUrl = getDeploymentUrl() + WorkRestATResource.PATH_SEGMENT;
    String pid = null;
    String pVal;
    pid = modifyResource(txn, pUrl, pid, "p1", "v1");
    pVal = getResourceProperty(txn, pUrl, pid, "p1");
    Assert.assertEquals(pVal, "v1");
    txn.startTx();
    pid = enlistResource(txn, pUrl + "?pId=" + pid);
    modifyResource(txn, pUrl, pid, "p1", "v2");
    pVal = getResourceProperty(txn, pUrl, pid, "p1");
    Assert.assertEquals(pVal, "v2");
    txn.rollbackTx();
    pVal = getResourceProperty(txn, pUrl, pid, "p1");
    Assert.assertEquals(pVal, "v1");
}
Also used : TxSupport(org.jboss.jbossts.star.util.TxSupport) Test(org.junit.Test)

Aggregations

TxSupport (org.jboss.jbossts.star.util.TxSupport)26 Test (org.junit.Test)18 HttpResponseException (org.jboss.jbossts.star.provider.HttpResponseException)4 HEAD (javax.ws.rs.HEAD)2 WebApplicationException (javax.ws.rs.WebApplicationException)2 ParticipantException (org.jboss.narayana.rest.integration.api.ParticipantException)2 GET (javax.ws.rs.GET)1 POST (javax.ws.rs.POST)1 Produces (javax.ws.rs.Produces)1 Before (org.junit.Before)1