activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r815684 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
Date Wed, 16 Sep 2009 09:20:53 GMT
Author: gtully
Date: Wed Sep 16 09:20:50 2009
New Revision: 815684

URL: http://svn.apache.org/viewvc?rev=815684&view=rev
Log:
resolve intermittent failure of test for https://issues.apache.org/activemq/browse/AMQ-1687
- wait for messages needs to wait for the outstanding count rather than just 10

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java?rev=815684&r1=815683&r2=815684&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
Wed Sep 16 09:20:50 2009
@@ -100,11 +100,10 @@
      * @param messageCount
      */
     public void waitForMessagesToArrive(int messageCount) {
-        LOG.info("Waiting for message to arrive");
-
+        final long maxRemainingMessageCount = Math.max(0, messageCount - messages.size());
+        LOG.info("Waiting for (" + maxRemainingMessageCount + ") message(s) to arrive");
    
         long start = System.currentTimeMillis();
-
-        for (int i = 0; i < 10; i++) {
+        for (int i = 0; i < maxRemainingMessageCount; i++) {
             try {
                 synchronized (semaphore) {
                     semaphore.wait(1000);



Mime
View raw message