use of com.arjuna.ats.internal.jbossatx.jta.jca.XATerminator in project wildfly by wildfly.
the class EJBClientXidTransactionTestCase method beforeTestClass.
/**
* Create and setup the remoting connection
*
* @throws Exception
*/
@BeforeClass
public static void beforeTestClass() throws Exception {
// These system properties are required or else we end up picking up JTS transaction manager,
// which is not what we want
final JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
jtaEnvironmentBean.setTransactionManagerClassName(TransactionManagerImple.class.getName());
jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(TransactionSynchronizationRegistryImple.class.getName());
final TransactionManager narayanaTm = jtaEnvironmentBean.getTransactionManager();
final TransactionSynchronizationRegistry narayanaTsr = jtaEnvironmentBean.getTransactionSynchronizationRegistry();
final XATerminator xat = new XATerminator();
final JBossLocalTransactionProvider.Builder builder = JBossLocalTransactionProvider.builder();
builder.setXATerminator(xat).setExtendedJBossXATerminator(xat);
builder.setTransactionManager(narayanaTm);
builder.setTransactionSynchronizationRegistry(narayanaTsr);
LocalTransactionContext.getContextManager().setGlobalDefault(new LocalTransactionContext(builder.build()));
txManager = ContextTransactionManager.getInstance();
txSyncRegistry = ContextTransactionSynchronizationRegistry.getInstance();
// setup the tx manager and tx sync registry
}
use of com.arjuna.ats.internal.jbossatx.jta.jca.XATerminator in project wildfly by wildfly.
the class HTTPEJBClientXidTransactionTestCase method beforeTestClass.
/**
* Create and setup the remoting connection
*
* @throws Exception
*/
@BeforeClass
public static void beforeTestClass() throws Exception {
// These system properties are required or else we end up picking up JTS transaction manager,
// which is not what we want
final JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
jtaEnvironmentBean.setTransactionManagerClassName(TransactionManagerImple.class.getName());
jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(TransactionSynchronizationRegistryImple.class.getName());
final TransactionManager narayanaTm = jtaEnvironmentBean.getTransactionManager();
final TransactionSynchronizationRegistry narayanaTsr = jtaEnvironmentBean.getTransactionSynchronizationRegistry();
final XATerminator xat = new XATerminator();
final JBossLocalTransactionProvider.Builder builder = JBossLocalTransactionProvider.builder();
builder.setXATerminator(xat).setExtendedJBossXATerminator(xat);
builder.setTransactionManager(narayanaTm);
builder.setTransactionSynchronizationRegistry(narayanaTsr);
LocalTransactionContext.getContextManager().setGlobalDefault(new LocalTransactionContext(builder.build()));
txManager = ContextTransactionManager.getInstance();
txSyncRegistry = ContextTransactionSynchronizationRegistry.getInstance();
// setup the tx manager and tx sync registry
AuthenticationConfiguration config = AuthenticationConfiguration.EMPTY.useName("user1").usePassword("password1");
AuthenticationContext context = AuthenticationContext.empty().with(MatchRule.ALL, config);
old = AuthenticationContext.captureCurrent();
AuthenticationContext.getContextManager().setGlobalDefault(context);
}
Aggregations