@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
} catch (JMSException e) { try { connection.close(); } catch (JMSException me) {
@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
@Override protected final void finalize() throws Throwable { if (!closed) { if (this.factoryReference.isFinalizeChecks()) { ActiveMQJMSClientLogger.LOGGER.connectionLeftOpen(creationStack); } close(); } }
@Override @After public void tearDown() throws Exception { testConn.close(); super.tearDown(); }
@Override @After public void tearDown() throws Exception { testConn.close(); super.tearDown(); }
@After public void stopServers() throws Exception { if (connection != null) { try { connection.close(); } catch (Exception e) { } } if (backupServer != null) { backupServer.stop(); backupServer = null; } if (liveServer != null) { liveServer.stop(); liveServer = null; } backupServer = liveServer = null; }
@Test public void testTemporaryQueueLeak() throws Exception { ActiveMQConnection conn = null; try { conn = (ActiveMQConnection) createConnection(); Session producerSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); Session consumerSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); TemporaryQueue tempQueue = producerSession.createTemporaryQueue(); MessageProducer producer = producerSession.createProducer(tempQueue); MessageConsumer consumer = consumerSession.createConsumer(tempQueue); conn.start(); final String messageText = "This is a message"; javax.jms.Message m = producerSession.createTextMessage(messageText); producer.send(m); TextMessage m2 = (TextMessage) consumer.receive(2000); assertNotNull(m2); assertEquals(messageText, m2.getText()); consumer.close(); tempQueue.delete(); assertFalse(conn.containsKnownDestination(SimpleString.toSimpleString(tempQueue.getQueueName()))); assertFalse(conn.containsTemporaryQueue(SimpleString.toSimpleString(tempQueue.getQueueName()))); } finally { if (conn != null) { conn.close(); } } } @Test
connLive.close();
} catch (JMSException e) { try { connection.close(); } catch (JMSException me) {
} catch (JMSException e) { try { connection.close(); } catch (JMSException me) {
} catch (JMSException e) { try { connection.close(); } catch (JMSException me) {
} catch (JMSException e) { try { connection.close(); } catch (JMSException me) {
Assert.assertEquals(FailoverEventType.FAILOVER_COMPLETED, listener.get(1)); conn.close(); Assert.assertEquals("Expected 2 FailoverEvents to be triggered", 2, listener.size());