Repository: activemq-artemis
Updated Branches:
  refs/heads/master 5ca690b3d -> a8c3e1b5f


ARTEMIS-1793 fix 'destination-type' STOMP header (test)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/37bc26e5
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/37bc26e5
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/37bc26e5

Branch: refs/heads/master
Commit: 37bc26e5740329f6b99c944535f38de2372ac92e
Parents: 5ca690b
Author: Justin Bertram <[email protected]>
Authored: Wed Apr 18 11:52:20 2018 -0400
Committer: Clebert Suconic <[email protected]>
Committed: Wed Apr 18 11:53:31 2018 -0400

----------------------------------------------------------------------
 .../tests/integration/stomp/StompTest.java      | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37bc26e5/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
----------------------------------------------------------------------
diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
index 5efc521..cd18d0c 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java
@@ -705,6 +705,42 @@ public class StompTest extends StompTestBase {
    }
 
    @Test
+   public void testAnycastDestinationTypeMessageProperty() throws Exception {
+      conn.connect(defUser, defPass);
+
+      subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO);
+
+      send(conn, getQueuePrefix() + getQueueName(), null, getName(), true, 
RoutingType.ANYCAST);
+
+      ClientStompFrame frame = conn.receiveFrame(10000);
+      Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand());
+      Assert.assertEquals(getQueuePrefix() + getQueueName(), 
frame.getHeader(Stomp.Headers.Send.DESTINATION));
+      Assert.assertEquals(RoutingType.ANYCAST.toString(), 
frame.getHeader(Stomp.Headers.Send.DESTINATION_TYPE));
+      
Assert.assertTrue(frame.getHeader(org.apache.activemq.artemis.api.core.Message.HDR_ROUTING_TYPE.toString())
 == null);
+      Assert.assertEquals(getName(), frame.getBody());
+
+      conn.disconnect();
+   }
+
+   @Test
+   public void testMulticastDestinationTypeMessageProperty() throws Exception {
+      conn.connect(defUser, defPass);
+
+      subscribeTopic(conn, null, null, null);
+
+      send(conn, getTopicPrefix() + getTopicName(), null, getName(), true, 
RoutingType.MULTICAST);
+
+      ClientStompFrame frame = conn.receiveFrame(10000);
+      Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand());
+      Assert.assertEquals(getTopicPrefix() + getTopicName(), 
frame.getHeader(Stomp.Headers.Send.DESTINATION));
+      Assert.assertEquals(RoutingType.MULTICAST.toString(), 
frame.getHeader(Stomp.Headers.Send.DESTINATION_TYPE));
+      
Assert.assertTrue(frame.getHeader(org.apache.activemq.artemis.api.core.Message.HDR_ROUTING_TYPE.toString())
 == null);
+      Assert.assertEquals(getName(), frame.getBody());
+
+      conn.disconnect();
+   }
+
+   @Test
    public void testSubscribeWithAutoAckAndBytesMessage() throws Exception {
       conn.connect(defUser, defPass);
       subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO);

Reply via email to