summaryrefslogtreecommitdiff
path: root/qpid
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2012-01-11 02:12:48 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2012-01-11 02:12:48 +0000
commitb7fcbdb8db0f9d210c107db77cf5d16af366b3fd (patch)
tree9e1aada739b4876a52478653c3ad91ef53be6485 /qpid
parenta9bc6b0db0cce45ae9f8d8ea5419978da0222aad (diff)
downloadqpid-python-b7fcbdb8db0f9d210c107db77cf5d16af366b3fd.tar.gz
NO_JIRA Modified the test to stop the connection to ensure the consumer
doesn't prefetch the messages until after the first message is replaced. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1229858 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
index e3557efd97..e7c3fad27d 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java
@@ -53,6 +53,10 @@ public class QueuePolicyTest extends QpidBrokerTestCase
super.tearDown();
}
+ /**
+ * Test Goal : To create a ring queue programitcally with max queue count using the
+ * address string and observe that it works as expected.
+ */
public void testRejectPolicy() throws Exception
{
String addr = "ADDR:queue; {create: always, " +
@@ -82,6 +86,10 @@ public class QueuePolicyTest extends QpidBrokerTestCase
}
}
+ /**
+ * Test Goal : To create a ring queue programitcally using the address string and observe
+ * that it works as expected.
+ */
public void testRingPolicy() throws Exception
{
Session ssn = _connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
@@ -94,17 +102,18 @@ public class QueuePolicyTest extends QpidBrokerTestCase
MessageConsumer consumer = ssn.createConsumer(dest);
MessageProducer prod = ssn.createProducer(ssn.createQueue("ADDR:amq.direct/test"));
+ _connection.stop();
+
prod.send(ssn.createTextMessage("Test1"));
prod.send(ssn.createTextMessage("Test2"));
prod.send(ssn.createTextMessage("Test3"));
+
+ _connection.start();
TextMessage msg = (TextMessage)consumer.receive(1000);
- assertEquals("The consumer should receive the msg with body='Test2'",msg.getText(),"Test2");
+ assertEquals("The consumer should receive the msg with body='Test2'","Test2",msg.getText());
msg = (TextMessage)consumer.receive(1000);
- assertEquals("The consumer should receive the msg with body='Test3'",msg.getText(),"Test3");
-
- prod.send(ssn.createTextMessage("Test4"));
- assertEquals("The consumer should receive the msg with body='Test4'",msg.getText(),"Test3");
+ assertEquals("The consumer should receive the msg with body='Test3'","Test3",msg.getText());
}
}