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);
}
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);
}
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;
}
Aggregations