You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/31 18:32:58 UTC

svn commit: r1441081 - /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java

Author: tabish
Date: Thu Jan 31 17:32:58 2013
New Revision: 1441081

URL: http://svn.apache.org/viewvc?rev=1441081&view=rev
Log:
apply fix for: https://issues.apache.org/jira/browse/AMQ-4288

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java?rev=1441081&r1=1441080&r2=1441081&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/OptimizedAckTest.java Thu Jan 31 17:32:58 2013
@@ -108,9 +108,10 @@ public class OptimizedAckTest extends Te
          for (int i=0; i<10; i++) {
              Thread.sleep(400);
             javax.jms.Message msg = consumer.receive(4000);
+             long inFlightCount = regionBroker.getDestinationStatistics().getInflight().getCount();
             assertNotNull(msg);
              if (i<7) {
-                 assertEquals("all prefetch is still in flight: " + i, 10, regionBroker.getDestinationStatistics().getInflight().getCount());
+                 assertEquals("all prefetch is still in flight: " + i, 10, inFlightCount);
              } else {
                  assertTrue("most are acked but 3 remain", Wait.waitFor(new Wait.Condition(){
                      @Override
@@ -145,9 +146,10 @@ public class OptimizedAckTest extends Te
 
          for (int i=0; i<10; i++) {
             javax.jms.Message msg = consumer.receive(4000);
+             long inFlightCount = regionBroker.getDestinationStatistics().getInflight().getCount();
             assertNotNull(msg);
              if (i<7) {
-                 assertEquals("all prefetch is still in flight", 10, regionBroker.getDestinationStatistics().getInflight().getCount());
+                 assertEquals("all prefetch is still in flight", 10, inFlightCount);
              } else {
                  assertTrue("most are acked but 3 remain", Wait.waitFor(new Wait.Condition(){
                      @Override