use of org.apache.activemq.artemis.service.extensions.xa.ActiveMQXAResourceWrapperImpl in project activemq-artemis by apache.
the class ActiveMQXAResourceWrapperImplTest method testXAResourceWrapper.
@Test
public void testXAResourceWrapper() {
String jndiName = "java://jmsXA";
String nodeId = "0";
XAResource xaResource = new MockXAResource();
Map<String, Object> xaResourceWrapperProperties = new HashMap<>();
xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, jndiName);
xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, nodeId);
xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_VERSION, "6");
xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, "ActiveMQ Artemis");
ActiveMQXAResourceWrapperImpl xaResourceWrapper = new ActiveMQXAResourceWrapperImpl(xaResource, xaResourceWrapperProperties);
String expectedJndiNodeId = jndiName + " NodeId:" + nodeId;
assertEquals(xaResource, xaResourceWrapper.getResource());
assertEquals(expectedJndiNodeId, xaResourceWrapper.getJndiName());
}
use of org.apache.activemq.artemis.service.extensions.xa.ActiveMQXAResourceWrapperImpl in project activemq-artemis by apache.
the class OutgoingConnectionTest method testOutgoingXAResourceWrapper.
@Test
public void testOutgoingXAResourceWrapper() throws Exception {
XAQueueConnection queueConnection = qraConnectionFactory.createXAQueueConnection();
XASession s = queueConnection.createXASession();
XAResource resource = s.getXAResource();
assertTrue(resource instanceof ActiveMQXAResourceWrapper);
ActiveMQXAResourceWrapperImpl xaResourceWrapper = (ActiveMQXAResourceWrapperImpl) resource;
assertTrue(xaResourceWrapper.getJndiName().equals("java://jmsXA NodeId:" + server.getNodeID()));
assertTrue(xaResourceWrapper.getProductVersion().equals(VersionLoader.getVersion().getFullVersion()));
assertTrue(xaResourceWrapper.getProductName().equals(ActiveMQResourceAdapter.PRODUCT_NAME));
}
Aggregations