activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1203662 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
Date Fri, 18 Nov 2011 14:23:33 GMT
Author: tabish
Date: Fri Nov 18 14:23:33 2011
New Revision: 1203662

URL: http://svn.apache.org/viewvc?rev=1203662&view=rev
Log:
Fix for NPE in test.

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java?rev=1203662&r1=1203661&r2=1203662&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java Fri
Nov 18 14:23:33 2011
@@ -335,7 +335,15 @@ public class AMQ1853Test {
                     bMessageReceiptIsOrdered = previousMessageId.trim().equals(message.getJMSMessageID());
                 }
 
-                AtomicInteger counter = messageList.get(message.getJMSMessageID());
+                final String jmsMessageId = message.getJMSMessageID();
+                assertTrue("Did not find expected ", Wait.waitFor(new Wait.Condition() {
+                    @Override
+                    public boolean isSatisified() throws Exception {
+                        return messageList.containsKey(jmsMessageId);
+                    }
+                }));
+
+                AtomicInteger counter = messageList.get(jmsMessageId);
                 counter.incrementAndGet();
 
                 LOG.info("Consumer for destination (" + destinationName + ")\n" + message.getJMSMessageID()
+ " = currentMessageId\n"
@@ -351,7 +359,7 @@ public class AMQ1853Test {
                     session.rollback(); // rolls back all the consumed messages on the session
to
                 }
 
-            } catch (JMSException ex) {
+            } catch (Exception ex) {
                 ex.printStackTrace();
                 LOG.error("Error reading JMS Message from destination " + destinationName
+ ".");
             }



Mime
View raw message