Author: rajith Date: Wed Jan 11 02:12:48 2012 New Revision: 1229858 URL: http://svn.apache.org/viewvc?rev=1229858&view=rev Log: 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.
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java?rev=1229858&r1=1229857&r2=1229858&view=diff ============================================================================== --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/queue/QueuePolicyTest.java Wed Jan 11 02:12:48 2012 @@ -53,6 +53,10 @@ public class QueuePolicyTest extends Qpi 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 Qpi } } + /** + * 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 Qpi 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()); } } --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org