diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java index da6d54e7df..96de7c4f02 100644 --- a/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java @@ -27,6 +27,7 @@ import javax.jms.MessageProducer; import javax.jms.Session; import junit.framework.TestCase; + import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.PolicyEntry; @@ -82,7 +83,6 @@ public class TopicProducerFlowControlTest extends TestCase implements MessageLis broker.waitUntilStarted(); } - protected void tearDown() throws Exception { broker.stop(); broker.waitUntilStopped(); @@ -138,19 +138,17 @@ public class TopicProducerFlowControlTest extends TestCase implements MessageLis assertEquals("Didn't produce all messages", numMessagesToSend, produced.get()); assertEquals("Didn't consume all messages", numMessagesToSend, consumed.get()); - } @Override public void onMessage(Message message) { - try { - Thread.sleep(1); - } catch (InterruptedException e) { - } - long count = consumed.incrementAndGet(); if (count % 100 == 0) { LOG.info("\tConsumed " + count + " messages"); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + } } } }