summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2008-03-07 15:35:07 +0000
committerRobert Godfrey <rgodfrey@apache.org>2008-03-07 15:35:07 +0000
commit9751f7cd99bd405cb1ad28cf738222fcb0be4fce (patch)
tree65617c9715f3d11c9915c3092d5d74025cd5b17c /java
parenta30bfbc4e1d9f9a683541dc6349552d588ad0df8 (diff)
downloadqpid-python-9751f7cd99bd405cb1ad28cf738222fcb0be4fce.tar.gz
QPID-839 : Fixed the hanging issue with this test; as yet unable to reproduce the test failure
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@634717 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
index 037c8285bc..8e9d56816c 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
@@ -82,8 +82,11 @@ public class DupsOkTest extends VMTestCase
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 @@ public class DupsOkTest extends VMTestCase
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()));
-
- //This is the last message so release test.
- _awaitCompletion.countDown();
+ try
+ {
+ int remainingMessages = getMessageCount(_queue.getQueueName());
+ if(remainingMessages != 0)
+ {
+
+ 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();
+ }
}
}