summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-09-01 10:23:04 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-09-01 10:23:04 +0000
commite366fbe041f11c5fec4f864e4f1dc25f19731482 (patch)
tree80df8b799b2e1138e4e37cd75c1da1b3742342a9
parent58f78f56a27b272a00eaaf0b803d198f59c3ba95 (diff)
downloadqpid-python-e366fbe041f11c5fec4f864e4f1dc25f19731482.tar.gz
QPID-2059 : Add some validation to verify suspension has been lifted correctly.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@809957 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
index 033c0533f8..3326ad0dd1 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
@@ -29,6 +29,7 @@ import javax.jms.MessageConsumer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.Topic;
+import javax.jms.Message;
import java.io.IOException;
import java.util.List;
@@ -335,31 +336,33 @@ public class SubscriptionLoggingTest extends AbstractTestLogging
//Fill the prefetch and two extra so that our receive bellow allows the
// subscription to become active then return to a suspended state.
- sendMessage(_session, _queue, 17);
+ int SEND_COUNT = 17;
+ sendMessage(_session, _queue, SEND_COUNT);
_session.commit();
// Retreive the first message, and start the flow of messages
- assertNotNull("First message not retreived", consumer.receive(1000));
+ Message msg = consumer.receive(1000);
+ assertNotNull("First message not retreived", msg);
_session.commit();
//Validate
List<String> results = _monitor.findMatches("SUB-1003");
-
- int i = 0;
- while (results.size() != 3 && i < 10)
+
+ // It has been seen on occasion that we do not get 3 messages logged.
+ // This could indicate that the broker has not received the above commit
+
+ // Check that we can received all the messages
+ int receivedCount = 0;
+ while (msg != null)
{
- try
- {
- Thread.sleep(1500);
- }
- catch (InterruptedException e)
- {
-
- }
- results = _monitor.findMatches("SUB-1003");
- i++;
+ receivedCount++;
+ msg = consumer.receive(1000);
+ _session.commit();
}
+ System.err.println("All messasges received correctly.");
+ assertEquals("Not all sent messages received.", SEND_COUNT, receivedCount);
+
try
{
// Validation expects three messages.