diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2012-01-11 02:12:48 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2012-01-11 02:12:48 +0000 |
| commit | baf8b1e88a5b757bde6f1364f8e12b84349f5faa (patch) | |
| tree | a8cb0efbded985dece1035eee3fc441a23a3003b /java | |
| parent | 921a1c732a4a73a4f10064f0293e342f2bc93973 (diff) | |
| download | qpid-python-baf8b1e88a5b757bde6f1364f8e12b84349f5faa.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/qpid@1229858 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java index e3557efd97..e7c3fad27d 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java +++ b/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()); } } |
