Search in sources :

Example 6 with JMSRuntimeException

use of javax.jms.JMSRuntimeException in project tomee by apache.

the class JMS2AMQTest method sendToMdb.

@Test
public void sendToMdb() throws Exception {
    try (final JMSContext context = cf.createContext()) {
        context.createProducer().send(destination, TEXT);
        assertTrue(Listener.sync());
    } catch (final JMSRuntimeException ex) {
        fail(ex.getMessage());
    }
}
Also used : JMSContext(javax.jms.JMSContext) JMSRuntimeException(javax.jms.JMSRuntimeException) Test(org.junit.Test)

Aggregations

JMSRuntimeException (javax.jms.JMSRuntimeException)6 JMSContext (javax.jms.JMSContext)5 Test (org.junit.Test)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 JMSConsumer (javax.jms.JMSConsumer)4 RequestScoped (javax.enterprise.context.RequestScoped)2 Message (javax.jms.Message)2 TextMessage (javax.jms.TextMessage)2 ContextsService (org.apache.webbeans.spi.ContextsService)2 MessageListener (javax.jms.MessageListener)1