activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1354291 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java
Date Tue, 26 Jun 2012 23:41:00 GMT
Author: tabish
Date: Tue Jun 26 23:40:59 2012
New Revision: 1354291

URL: http://svn.apache.org/viewvc?rev=1354291&view=rev
Log:
apply patch for: https://issues.apache.org/jira/browse/AMQ-3900

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java?rev=1354291&r1=1354290&r2=1354291&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicProducerFlowControlTest.java
Tue Jun 26 23:40:59 2012
@@ -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 TopicProducerFlowControlTes
         broker.waitUntilStarted();
     }
 
-
     protected void tearDown() throws Exception {
         broker.stop();
         broker.waitUntilStopped();
@@ -138,19 +138,17 @@ public class TopicProducerFlowControlTes
 
         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) {
+            }
         }
     }
 }



Mime
View raw message