Search in sources :

Example 1 with XATopicConnectionFactory

use of javax.jms.XATopicConnectionFactory in project activemq-artemis by apache.

the class ConnectionFactoryTest method testFactoryTypes.

@Test
public void testFactoryTypes() throws Exception {
    deployConnectionFactory(0, JMSFactoryType.CF, "ConnectionFactory", "/ConnectionFactory");
    deployConnectionFactory(0, JMSFactoryType.QUEUE_XA_CF, "CF_QUEUE_XA_TRUE", "/CF_QUEUE_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.QUEUE_CF, "CF_QUEUE_XA_FALSE", "/CF_QUEUE_XA_FALSE");
    deployConnectionFactory(0, JMSFactoryType.XA_CF, "CF_XA_TRUE", "/CF_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.CF, "CF_XA_FALSE", "/CF_XA_FALSE");
    deployConnectionFactory(0, JMSFactoryType.QUEUE_CF, "CF_QUEUE", "/CF_QUEUE");
    deployConnectionFactory(0, JMSFactoryType.TOPIC_CF, "CF_TOPIC", "/CF_TOPIC");
    deployConnectionFactory(0, JMSFactoryType.TOPIC_XA_CF, "CF_TOPIC_XA_TRUE", "/CF_TOPIC_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.CF, "CF_GENERIC", "/CF_GENERIC");
    deployConnectionFactory(0, JMSFactoryType.XA_CF, "CF_GENERIC_XA_TRUE", "/CF_GENERIC_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.CF, "CF_GENERIC_XA_FALSE", "/CF_GENERIC_XA_FALSE");
    deployConnectionFactory(0, JMSFactoryType.TOPIC_CF, "CF_TOPIC_XA_FALSE", "/CF_TOPIC_XA_FALSE");
    ActiveMQConnectionFactory factory = null;
    factory = (ActiveMQConnectionFactory) ic.lookup("/ConnectionFactory");
    Assert.assertTrue(factory instanceof ConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_XA_TRUE");
    Assert.assertTrue(factory instanceof XAConnectionFactory);
    assertNTypes(factory, 6);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_XA_FALSE");
    Assert.assertTrue(factory instanceof ConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_GENERIC");
    Assert.assertTrue(factory instanceof ConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_GENERIC_XA_TRUE");
    Assert.assertTrue(factory instanceof XAConnectionFactory);
    assertNTypes(factory, 6);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_GENERIC_XA_FALSE");
    Assert.assertTrue(factory instanceof ConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_QUEUE");
    Assert.assertTrue(factory instanceof QueueConnectionFactory);
    assertNTypes(factory, 3);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_QUEUE_XA_TRUE");
    Assert.assertTrue(factory instanceof XAQueueConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_QUEUE_XA_FALSE");
    Assert.assertTrue(factory instanceof QueueConnectionFactory);
    assertNTypes(factory, 3);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_TOPIC");
    Assert.assertTrue(factory instanceof TopicConnectionFactory);
    assertNTypes(factory, 3);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_TOPIC_XA_TRUE");
    Assert.assertTrue(factory instanceof XATopicConnectionFactory);
    assertNTypes(factory, 4);
    factory = (ActiveMQConnectionFactory) ic.lookup("/CF_TOPIC_XA_FALSE");
    Assert.assertTrue(factory instanceof TopicConnectionFactory);
    assertNTypes(factory, 3);
    undeployConnectionFactory("ConnectionFactory");
    undeployConnectionFactory("CF_QUEUE_XA_TRUE");
    undeployConnectionFactory("CF_QUEUE_XA_FALSE");
    undeployConnectionFactory("CF_XA_TRUE");
    undeployConnectionFactory("CF_XA_FALSE");
    undeployConnectionFactory("CF_QUEUE");
    undeployConnectionFactory("CF_TOPIC");
    undeployConnectionFactory("CF_TOPIC_XA_TRUE");
    undeployConnectionFactory("CF_GENERIC");
    undeployConnectionFactory("CF_GENERIC_XA_TRUE");
    undeployConnectionFactory("CF_GENERIC_XA_FALSE");
    undeployConnectionFactory("CF_TOPIC_XA_FALSE");
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) TopicConnectionFactory(javax.jms.TopicConnectionFactory) ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) XAConnectionFactory(javax.jms.XAConnectionFactory) QueueConnectionFactory(javax.jms.QueueConnectionFactory) XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) TopicConnectionFactory(javax.jms.TopicConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) QueueConnectionFactory(javax.jms.QueueConnectionFactory) XAConnectionFactory(javax.jms.XAConnectionFactory) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) Test(org.junit.Test)

Example 2 with XATopicConnectionFactory

use of javax.jms.XATopicConnectionFactory in project activemq-artemis by apache.

the class ConnectionFactoryTest method testConnectionTypes.

@Test
public void testConnectionTypes() throws Exception {
    deployConnectionFactory(0, JMSFactoryType.CF, "ConnectionFactory", "/ConnectionFactory");
    deployConnectionFactory(0, JMSFactoryType.QUEUE_XA_CF, "CF_QUEUE_XA_TRUE", "/CF_QUEUE_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.XA_CF, "CF_XA_TRUE", "/CF_XA_TRUE");
    deployConnectionFactory(0, JMSFactoryType.QUEUE_CF, "CF_QUEUE", "/CF_QUEUE");
    deployConnectionFactory(0, JMSFactoryType.TOPIC_CF, "CF_TOPIC", "/CF_TOPIC");
    deployConnectionFactory(0, JMSFactoryType.TOPIC_XA_CF, "CF_TOPIC_XA_TRUE", "/CF_TOPIC_XA_TRUE");
    Connection genericConnection = null;
    XAConnection xaConnection = null;
    QueueConnection queueConnection = null;
    TopicConnection topicConnection = null;
    XAQueueConnection xaQueueConnection = null;
    XATopicConnection xaTopicConnection = null;
    ConnectionFactory genericFactory = (ConnectionFactory) ic.lookup("/ConnectionFactory");
    genericConnection = genericFactory.createConnection();
    assertConnectionType(genericConnection, "generic");
    XAConnectionFactory xaFactory = (XAConnectionFactory) ic.lookup("/CF_XA_TRUE");
    xaConnection = xaFactory.createXAConnection();
    assertConnectionType(xaConnection, "xa");
    QueueConnectionFactory queueCF = (QueueConnectionFactory) ic.lookup("/CF_QUEUE");
    queueConnection = queueCF.createQueueConnection();
    assertConnectionType(queueConnection, "queue");
    TopicConnectionFactory topicCF = (TopicConnectionFactory) ic.lookup("/CF_TOPIC");
    topicConnection = topicCF.createTopicConnection();
    assertConnectionType(topicConnection, "topic");
    XAQueueConnectionFactory xaQueueCF = (XAQueueConnectionFactory) ic.lookup("/CF_QUEUE_XA_TRUE");
    xaQueueConnection = xaQueueCF.createXAQueueConnection();
    assertConnectionType(xaQueueConnection, "xa-queue");
    XATopicConnectionFactory xaTopicCF = (XATopicConnectionFactory) ic.lookup("/CF_TOPIC_XA_TRUE");
    xaTopicConnection = xaTopicCF.createXATopicConnection();
    assertConnectionType(xaTopicConnection, "xa-topic");
    genericConnection.close();
    xaConnection.close();
    queueConnection.close();
    topicConnection.close();
    xaQueueConnection.close();
    xaTopicConnection.close();
    undeployConnectionFactory("ConnectionFactory");
    undeployConnectionFactory("CF_QUEUE_XA_TRUE");
    undeployConnectionFactory("CF_XA_TRUE");
    undeployConnectionFactory("CF_QUEUE");
    undeployConnectionFactory("CF_TOPIC");
    undeployConnectionFactory("CF_TOPIC_XA_TRUE");
}
Also used : XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) TopicConnectionFactory(javax.jms.TopicConnectionFactory) ActiveMQConnectionFactory(org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) XAConnectionFactory(javax.jms.XAConnectionFactory) QueueConnectionFactory(javax.jms.QueueConnectionFactory) XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) TopicConnectionFactory(javax.jms.TopicConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) XAQueueConnection(javax.jms.XAQueueConnection) QueueConnection(javax.jms.QueueConnection) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) QueueConnectionFactory(javax.jms.QueueConnectionFactory) XAQueueConnection(javax.jms.XAQueueConnection) XAConnection(javax.jms.XAConnection) XATopicConnection(javax.jms.XATopicConnection) Connection(javax.jms.Connection) TopicConnection(javax.jms.TopicConnection) QueueConnection(javax.jms.QueueConnection) XAConnectionFactory(javax.jms.XAConnectionFactory) XATopicConnection(javax.jms.XATopicConnection) XAQueueConnectionFactory(javax.jms.XAQueueConnectionFactory) XATopicConnectionFactory(javax.jms.XATopicConnectionFactory) XAQueueConnection(javax.jms.XAQueueConnection) XATopicConnection(javax.jms.XATopicConnection) TopicConnection(javax.jms.TopicConnection) XAConnection(javax.jms.XAConnection) Test(org.junit.Test)

Aggregations

ConnectionFactory (javax.jms.ConnectionFactory)2 QueueConnectionFactory (javax.jms.QueueConnectionFactory)2 TopicConnectionFactory (javax.jms.TopicConnectionFactory)2 XAConnectionFactory (javax.jms.XAConnectionFactory)2 XAQueueConnectionFactory (javax.jms.XAQueueConnectionFactory)2 XATopicConnectionFactory (javax.jms.XATopicConnectionFactory)2 ActiveMQConnectionFactory (org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory)2 Test (org.junit.Test)2 Connection (javax.jms.Connection)1 QueueConnection (javax.jms.QueueConnection)1 TopicConnection (javax.jms.TopicConnection)1 XAConnection (javax.jms.XAConnection)1 XAQueueConnection (javax.jms.XAQueueConnection)1 XATopicConnection (javax.jms.XATopicConnection)1