You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2010/05/04 01:35:57 UTC
svn commit: r940674 -
/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Author: rajith
Date: Mon May 3 23:35:56 2010
New Revision: 940674
URL: http://svn.apache.org/viewvc?rev=940674&view=rev
Log:
Removed assertions based on wrong assumptions.
The c++ broker does not make any guarantees about how it distributes the messages among consumers on a single queue.
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java?rev=940674&r1=940673&r2=940674&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java Mon May 3 23:35:56 2010
@@ -213,27 +213,26 @@ public class AMQConnectionTest extends Q
// Send 3 messages
for (int i = 0; i < 3; i++)
{
- producer.send(producerSession.createTextMessage(new Integer(i).toString()));
+ producer.send(producerSession.createTextMessage("test"));
}
+
Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumerB = consSessB.createConsumer(_queue);
Message msg;
- // Check that one consumer has 2 messages
+ // Check that consumer A has 2 messages
for (int i = 0; i < 2; i++)
{
msg = consumerA.receive(1500);
- assertNotNull(msg);
- assertEquals(new Integer(i).toString(), ((TextMessage) msg).getText());
+ assertNotNull("Consumer A should receive 2 messages",msg);
}
msg = consumerA.receive(1500);
- assertNull(msg);
+ assertNull("Consumer A should not have received a 3rd message",msg);
- // Check that other consumer has last message
+ // Check that consumer B has the last message
msg = consumerB.receive(1500);
- assertNotNull(msg);
- assertEquals(new Integer(2).toString(), ((TextMessage) msg).getText());
+ assertNotNull("Consumer B should have received the message",msg);
}
finally
{
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org