Allow tests to set TM in TMLocatorImpl
Some tests require a proper TM to be returned by the TMLocator implementation whilst others require a DummyTM to be returned. This patch makes allows TM returned by the locator class to be changed by the test.
This commit is contained in:
parent
39c61014ac
commit
739c0f368b
|
@ -28,9 +28,11 @@ import org.apache.activemq.service.extensions.transactions.TransactionManagerLoc
|
|||
|
||||
public class TransactionManagerLocatorImpl implements TransactionManagerLocator
|
||||
{
|
||||
public static TransactionManager tm = new TransactionManagerImple();
|
||||
|
||||
@Override
|
||||
public TransactionManager getTransactionManager()
|
||||
{
|
||||
return new TransactionManagerImple();
|
||||
return tm;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.activemq.ra.ActiveMQRAConnectionFactoryImpl;
|
|||
import org.apache.activemq.ra.ActiveMQRAConnectionManager;
|
||||
import org.apache.activemq.ra.ActiveMQRAManagedConnectionFactory;
|
||||
import org.apache.activemq.ra.ActiveMQResourceAdapter;
|
||||
import org.apache.activemq.tests.integration.jms.bridge.TransactionManagerLocatorImpl;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -63,6 +64,7 @@ public class JMSContextTest extends ActiveMQRATestBase
|
|||
|
||||
resourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
|
||||
MyBootstrapContext ctx = new MyBootstrapContext();
|
||||
TransactionManagerLocatorImpl.tm = DummyTransactionManager.tm;
|
||||
resourceAdapter.start(ctx);
|
||||
ActiveMQRAManagedConnectionFactory mcf = new ActiveMQRAManagedConnectionFactory();
|
||||
mcf.setResourceAdapter(resourceAdapter);
|
||||
|
|
|
@ -286,7 +286,6 @@ public class OutgoingConnectionTest extends ActiveMQRATestBase
|
|||
{
|
||||
setupDLQ(10);
|
||||
resourceAdapter = newResourceAdapter();
|
||||
DummyTransactionManager.tm.tx = new DummyTransaction();
|
||||
MyBootstrapContext ctx = new MyBootstrapContext();
|
||||
resourceAdapter.start(ctx);
|
||||
ActiveMQRAManagedConnectionFactory mcf = new ActiveMQRAManagedConnectionFactory();
|
||||
|
|
Loading…
Reference in New Issue