qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1570563 - /qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java
Date Fri, 21 Feb 2014 13:09:40 GMT
Author: robbie
Date: Fri Feb 21 13:09:40 2014
New Revision: 1570563

URL: http://svn.apache.org/r1570563
Log:
QPIDJMS-9: add an integration test for sending messages with group properties set

Modified:
    qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java

Modified: qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java
URL: http://svn.apache.org/viewvc/qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java?rev=1570563&r1=1570562&r2=1570563&view=diff
==============================================================================
--- qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java (original)
+++ qpid/jms/trunk/src/test/java/org/apache/qpid/jms/MessageIntegrationTest.java Fri Feb 21
13:09:40 2014
@@ -895,4 +895,53 @@ public class MessageIntegrationTest exte
             assertEquals("did not get the expected JMS_AMQP_REPLY_TO_GROUP_ID", expectedReplyToGroupId,
receivedMessage.getStringProperty(ClientProperties.JMS_AMQP_REPLY_TO_GROUP_ID));
         }
     }
+
+    /**
+     * Tests that when sending a message with the JMSXGroupID, JMSXGroupSeq, and JMS_AMQP_REPLY_TO_GROUP_ID
+     * properties of the JMS message set, that the expected values are included in the fields
of
+     * the AMQP message emitted.
+     */
+    @Test
+    public void testSendMessageWithGroupRelatedPropertiesSet() throws Exception
+    {
+        try(TestAmqpPeer testPeer = new TestAmqpPeer(IntegrationTestFixture.PORT);)
+        {
+            Connection connection = _testFixture.establishConnecton(testPeer);
+            testPeer.expectBegin();
+            testPeer.expectSenderAttach();
+
+            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            String queueName = "myQueue";
+            Queue queue = session.createQueue(queueName);
+            MessageProducer producer = session.createProducer(queue);
+
+            MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
+            MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true);
+
+            String expectedGroupId = "myGroupId123";
+            int expectedGroupSeq = 1;
+            String expectedReplyToGroupId = "myReplyToGroupId456";
+
+            MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true);
+            propsMatcher.withGroupId(equalTo(expectedGroupId));
+            propsMatcher.withReplyToGroupId(equalTo(expectedReplyToGroupId));
+            propsMatcher.withGroupSequence(equalTo(UnsignedInteger.valueOf(expectedGroupSeq)));
+
+            TransferPayloadCompositeMatcher messageMatcher = new TransferPayloadCompositeMatcher();
+            messageMatcher.setHeadersMatcher(headersMatcher);
+            messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
+            messageMatcher.setPropertiesMatcher(propsMatcher);
+            messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
+            testPeer.expectTransfer(messageMatcher);
+
+            Message message = session.createTextMessage();
+            message.setStringProperty(ClientProperties.JMSXGROUPID, expectedGroupId);
+            message.setIntProperty(ClientProperties.JMSXGROUPSEQ, expectedGroupSeq);
+            message.setStringProperty(ClientProperties.JMS_AMQP_REPLY_TO_GROUP_ID, expectedReplyToGroupId);
+
+            producer.send(message);
+
+            testPeer.waitForAllHandlersToComplete(1000);
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message