Search in sources :

Example 1 with CompensatableService

use of org.jboss.as.test.xts.annotation.service.CompensatableService in project wildfly by wildfly.

the class CompensatableTestCase method testNoTransaction.

@Test
public void testNoTransaction() throws Exception {
    final String deploymentUrl = DEPLOYMENT_URL;
    final CompensatableService compensatableService = CompensatableClient.newInstance(deploymentUrl);
    final boolean isTransactionActive = compensatableService.isTransactionActive();
    Assert.assertEquals(false, isTransactionActive);
}
Also used : CompensatableService(org.jboss.as.test.xts.annotation.service.CompensatableService) Test(org.junit.Test)

Example 2 with CompensatableService

use of org.jboss.as.test.xts.annotation.service.CompensatableService in project wildfly by wildfly.

the class CompensatableTestCase method testActiveTransaction.

@Test
public void testActiveTransaction() throws Exception {
    final String deploymentUrl = DEPLOYMENT_URL;
    final CompensatableService compensatableService = CompensatableClient.newInstance(deploymentUrl);
    final UserBusinessActivity userBusinessActivity = UserBusinessActivity.getUserBusinessActivity();
    userBusinessActivity.begin();
    final boolean isTransactionActive = compensatableService.isTransactionActive();
    userBusinessActivity.close();
    Assert.assertEquals(true, isTransactionActive);
}
Also used : UserBusinessActivity(com.arjuna.mw.wst11.UserBusinessActivity) CompensatableService(org.jboss.as.test.xts.annotation.service.CompensatableService) Test(org.junit.Test)

Example 3 with CompensatableService

use of org.jboss.as.test.xts.annotation.service.CompensatableService in project wildfly by wildfly.

the class CompensatableClient method newInstance.

public static CompensatableService newInstance(final String deploymentUrl) throws MalformedURLException {
    LOG.debug("CompensatableClient.newInstance(deploymentUrl = " + deploymentUrl + ")");
    final URL wsdlLocation = new URL(deploymentUrl + "/" + NAME + "?wsdl");
    LOG.debug("wsdlLocation for service: " + wsdlLocation);
    final QName serviceName = new QName(TARGET_NAMESPACE, SERVICE_NAME);
    final QName portName = new QName(TARGET_NAMESPACE, PORT_NAME);
    final Service service = Service.create(wsdlLocation, serviceName);
    final CompensatableService compensatableService = service.getPort(portName, CompensatableService.class);
    return compensatableService;
}
Also used : QName(javax.xml.namespace.QName) CompensatableService(org.jboss.as.test.xts.annotation.service.CompensatableService) CompensatableService(org.jboss.as.test.xts.annotation.service.CompensatableService) Service(javax.xml.ws.Service) URL(java.net.URL)

Aggregations

CompensatableService (org.jboss.as.test.xts.annotation.service.CompensatableService)3 Test (org.junit.Test)2 UserBusinessActivity (com.arjuna.mw.wst11.UserBusinessActivity)1 URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1