Search in sources :

Example 1 with JmsDestination

use of com.adaptris.core.jms.JmsDestination in project interlok by adaptris.

the class BasicActiveMqImplementationTest method testRfc6167_Basic.

@Test
public void testRfc6167_Basic() throws Exception {
    StandaloneProducer producer = null;
    try {
        BasicActiveMqImplementation vendorImp = create();
        PtpProducer ptp = new PtpProducer().withQueue((testName.getMethodName()));
        producer = new StandaloneProducer(activeMqBroker.getJmsConnection(vendorImp), ptp);
        start(producer);
        // Send a message so that the session is correct.
        producer.doService(AdaptrisMessageFactory.getDefaultInstance().newMessage("abcde"));
        JmsDestination jmsDest = vendorImp.createDestination("jms:queue:myQueueName", ptp);
        assertNotNull(jmsDest.getDestination());
        assertTrue(javax.jms.Queue.class.isAssignableFrom(jmsDest.getDestination().getClass()));
        assertNull(jmsDest.deliveryMode());
        assertNull(jmsDest.getReplyToDestination());
        assertNull(jmsDest.priority());
        assertNull(jmsDest.timeToLive());
        assertNull(jmsDest.subscriptionId());
        assertFalse(jmsDest.noLocal());
    } finally {
        stop(producer);
    }
}
Also used : PtpProducer(com.adaptris.core.jms.PtpProducer) JmsDestination(com.adaptris.core.jms.JmsDestination) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Example 2 with JmsDestination

use of com.adaptris.core.jms.JmsDestination in project interlok by adaptris.

the class BasicActiveMqImplementationTest method testRfc6167_WithParams.

@Test
public void testRfc6167_WithParams() throws Exception {
    StandaloneProducer producer = null;
    try {
        BasicActiveMqImplementation vendorImp = create();
        PtpProducer ptp = new PtpProducer().withQueue((testName.getMethodName()));
        producer = new StandaloneProducer(activeMqBroker.getJmsConnection(vendorImp), ptp);
        start(producer);
        // Send a message so that the session is correct.
        producer.doService(AdaptrisMessageFactory.getDefaultInstance().newMessage("abcde"));
        JmsDestination jmsDest = vendorImp.createDestination("jms:queue:MyQueueName?replyToName=StaticReplyTo&priority=1&deliveryMode=NON_PERSISTENT&timeToLive=1000", ptp);
        assertNotNull(jmsDest.getDestination());
        assertTrue(javax.jms.Queue.class.isAssignableFrom(jmsDest.getDestination().getClass()));
        assertNotNull(jmsDest.getReplyToDestination());
        assertTrue(javax.jms.Queue.class.isAssignableFrom(jmsDest.getReplyToDestination().getClass()));
        assertNotNull(jmsDest.deliveryMode());
        assertEquals("NON_PERSISTENT", jmsDest.deliveryMode());
        assertNotNull(jmsDest.priority());
        assertEquals(Integer.valueOf(1), jmsDest.priority());
        assertNotNull(jmsDest.timeToLive());
        assertEquals(Long.valueOf(1000), jmsDest.timeToLive());
        assertNull(jmsDest.subscriptionId());
        assertFalse(jmsDest.noLocal());
    } finally {
        stop(producer);
    }
}
Also used : PtpProducer(com.adaptris.core.jms.PtpProducer) JmsDestination(com.adaptris.core.jms.JmsDestination) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Aggregations

StandaloneProducer (com.adaptris.core.StandaloneProducer)2 JmsDestination (com.adaptris.core.jms.JmsDestination)2 PtpProducer (com.adaptris.core.jms.PtpProducer)2 Test (org.junit.Test)2