From 431478a8f5710bb30527bb3041eca2d44a8f2c58 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Mon, 31 Mar 2008 23:15:45 +0000 Subject: [PATCH] do best effort to drain the queues.. and error should not interrupt the connection and broker shutdown. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@643205 13f79535-47bb-0310-9956-ffa450edef68 --- .../bugs/amq1095/ActiveMQTestCase.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/amq1095/ActiveMQTestCase.java b/activemq-core/src/test/java/org/apache/activemq/bugs/amq1095/ActiveMQTestCase.java index 34a5f11cee..0beef83a89 100644 --- a/activemq-core/src/test/java/org/apache/activemq/bugs/amq1095/ActiveMQTestCase.java +++ b/activemq-core/src/test/java/org/apache/activemq/bugs/amq1095/ActiveMQTestCase.java @@ -142,14 +142,17 @@ public class ActiveMQTestCase extends TestCase */ protected void tearDown() throws Exception { TextMessage msg; - for (final Iterator i = consumersToEmpty.iterator(); i.hasNext();) - { - final MessageConsumer consumer = (MessageConsumer) i.next(); - if (consumer != null) - do - msg = (TextMessage) consumer.receive(RECEIVE_TIMEOUT); - while (msg != null); - } + try { + for (final Iterator i = consumersToEmpty.iterator(); i.hasNext();) + { + final MessageConsumer consumer = (MessageConsumer) i.next(); + if (consumer != null) + do + msg = (TextMessage) consumer.receive(RECEIVE_TIMEOUT); + while (msg != null); + } + } catch (Exception e) { + } if (connection != null) { connection.stop(); }