use of org.jboss.as.test.xts.annotation.service.TransactionalService in project wildfly by wildfly.
the class TransactionalClient method newInstance.
public static TransactionalService newInstance(final String deploymentUrl) throws MalformedURLException {
LOG.debug("TransactionalClient.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 TransactionalService transactionalService = service.getPort(portName, TransactionalService.class);
return transactionalService;
}
use of org.jboss.as.test.xts.annotation.service.TransactionalService in project wildfly by wildfly.
the class TransactionalTestCase method testNoTransaction.
@Test
public void testNoTransaction() throws Exception {
final String deploymentUrl = DEPLOYMENT_URL;
final TransactionalService transactionalService = TransactionalClient.newInstance(deploymentUrl);
final boolean isTransactionActive = transactionalService.isTransactionActive();
Assert.assertEquals(false, isTransactionActive);
}
use of org.jboss.as.test.xts.annotation.service.TransactionalService in project wildfly by wildfly.
the class TransactionalTestCase method testActiveTransaction.
@Test
public void testActiveTransaction() throws Exception {
final String deploymentUrl = DEPLOYMENT_URL;
final TransactionalService transactionalService = TransactionalClient.newInstance(deploymentUrl);
final UserTransaction userTransaction = UserTransaction.getUserTransaction();
userTransaction.begin();
final boolean isTransactionActive = transactionalService.isTransactionActive();
userTransaction.commit();
Assert.assertEquals(true, isTransactionActive);
}
Aggregations