use of org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException in project activemq-artemis by apache.
the class ExceptionListenerTest method testListenerCalledForOneConnection.
@Test
public void testListenerCalledForOneConnection() throws Exception {
Connection conn = cf.createConnection();
CountDownLatch latch = new CountDownLatch(1);
MyExceptionListener listener = new MyExceptionListener(latch);
conn.setExceptionListener(listener);
ClientSessionInternal coreSession = (ClientSessionInternal) ((ActiveMQConnection) conn).getInitialSession();
coreSession.getConnection().fail(new ActiveMQInternalErrorException("blah"));
latch.await(5, TimeUnit.SECONDS);
Assert.assertEquals(1, listener.numCalls);
conn.close();
}
Aggregations