From fed9ac7955562ccae79740c9ec8e261b222254f3 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Fri, 29 Jan 2010 11:42:46 +0000 Subject: [PATCH] https://issues.apache.org/activemq/browse/AMQ-2507 - improving test, avoiding false positives git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@904468 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/bugs/JmsTimeoutTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsTimeoutTest.java b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsTimeoutTest.java index 47b62b7e8c..a5d6638f5a 100644 --- a/activemq-core/src/test/java/org/apache/activemq/bugs/JmsTimeoutTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/bugs/JmsTimeoutTest.java @@ -55,8 +55,10 @@ public class JmsTimeoutTest extends EmbeddedBrokerTestSupport { logger.info("Done sending.."); } catch (JMSException e) { e.printStackTrace(); - exceptionCount.incrementAndGet(); - return; + if (e instanceof ResourceAllocationException) { + exceptionCount.incrementAndGet(); + } + return; } } }; @@ -66,7 +68,7 @@ public class JmsTimeoutTest extends EmbeddedBrokerTestSupport { producerThread.join(30000); cx.close(); // We should have a few timeout exceptions as memory store will fill up - assertTrue(exceptionCount.get() > 0); + assertTrue("No exception from the broker", exceptionCount.get() > 0); } protected void setUp() throws Exception {