qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r634717 - /incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
Date Fri, 07 Mar 2008 15:35:08 GMT
Author: rgodfrey
Date: Fri Mar  7 07:35:07 2008
New Revision: 634717

URL: http://svn.apache.org/viewvc?rev=634717&view=rev
Log:
QPID-839 : Fixed the hanging issue with this test; as yet unable to reproduce the test failure

Modified:
    incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java

Modified: incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java?rev=634717&r1=634716&r2=634717&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
(original)
+++ incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
Fri Mar  7 07:35:07 2008
@@ -82,8 +82,11 @@
 
         consumer.setMessageListener(new MessageListener()
         {
+            int _msgCount = 0;
+
             public void onMessage(Message message)
             {
+                _msgCount++;
                 if (message == null)
                 {
                     fail("Should not get null messages");
@@ -98,12 +101,22 @@
                             assertEquals("The queue should have 4999 msgs left", 4999, getMessageCount(_queue.getQueueName()));
                         }*/
 
-                        if (message.getIntProperty("count") == 9999)
+                        if (message.getIntProperty("count") == MSG_COUNT)
                         {
-                            assertEquals("The queue should have 0 msgs left", 0, getMessageCount(_queue.getQueueName()));
+                            try
+                            {
+                                int remainingMessages = getMessageCount(_queue.getQueueName());
+                                if(remainingMessages != 0)
+                                {
 
-                            //This is the last message so release test.
-                            _awaitCompletion.countDown();
+                                    assertEquals("The queue should have 0 msgs left, seen
" + _msgCount + " messages.", 0, getMessageCount(_queue.getQueueName()));
+                                }
+                            }
+                            finally
+                            {
+                                //This is the last message so release test.
+                                _awaitCompletion.countDown();
+                            }
                         }
 
                     }



Mime
View raw message