use of org.infinispan.transaction.xa.XaTransactionTable in project infinispan by infinispan.
the class ForgetTest method createCacheManagers.
@Override
protected void createCacheManagers() throws Throwable {
ConfigurationBuilder configuration = defaultRecoveryConfig();
createCluster(configuration, 2);
waitForClusterToForm();
XaTransactionTable txTable = tt(0);
PostCommitRecoveryStateTest.RecoveryManagerDelegate recoveryManager = new PostCommitRecoveryStateTest.RecoveryManagerDelegate(TestingUtil.extractComponent(cache(0), RecoveryManager.class));
TestingUtil.replaceField(recoveryManager, "recoveryManager", txTable, XaTransactionTable.class);
}
use of org.infinispan.transaction.xa.XaTransactionTable in project infinispan by infinispan.
the class TransactionXaAdapterTmIntegrationTest method setUp.
@BeforeMethod
public void setUp() throws XAException {
Configuration configuration = new ConfigurationBuilder().build();
XaTransactionTable txTable = new XaTransactionTable();
txCoordinator = new TransactionCoordinator();
TestingUtil.inject(txTable, configuration, txCoordinator, TransactionOriginatorChecker.LOCAL);
txTable.start();
txTable.startXidMapping();
TransactionFactory gtf = new TransactionFactory();
gtf.init(false, false, true, false);
GlobalTransaction globalTransaction = gtf.newGlobalTransaction(null, false);
EmbeddedBaseTransactionManager tm = new EmbeddedBaseTransactionManager();
localTx = new LocalXaTransaction(new EmbeddedTransaction(tm), globalTransaction, false, 1, 0);
xid = EmbeddedTransaction.createXid(uuid);
InvocationContextFactory icf = new TransactionalInvocationContextFactory();
CommandsFactory commandsFactory = mock(CommandsFactory.class);
AsyncInterceptorChain invoker = mock(AsyncInterceptorChain.class);
when(invoker.invokeAsync(any(), any())).thenReturn(CompletableFutures.completedNull());
TestingUtil.inject(txCoordinator, commandsFactory, icf, invoker, txTable, configuration);
xaAdapter = new TransactionXaAdapter(localTx, txTable);
xaAdapter.start(xid, 0);
}
use of org.infinispan.transaction.xa.XaTransactionTable in project infinispan by infinispan.
the class PostCommitRecoveryStateTest method createCacheManagers.
@Override
protected void createCacheManagers() throws Throwable {
ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true);
configuration.locking().useLockStriping(false).transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()).useSynchronization(false).recovery().enable().clustering().stateTransfer().fetchInMemoryState(false);
createCluster(configuration, 2);
waitForClusterToForm();
ComponentRegistry componentRegistry = this.cache(0).getAdvancedCache().getComponentRegistry();
XaTransactionTable txTable = (XaTransactionTable) componentRegistry.getComponent(TransactionTable.class);
TestingUtil.replaceField(new RecoveryManagerDelegate(TestingUtil.extractComponent(cache(0), RecoveryManager.class)), "recoveryManager", txTable, XaTransactionTable.class);
}
Aggregations