activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: NO-JIRA: Add test to show behavior of non-prefixed addresses that default to Queue.
Date Fri, 10 Jun 2016 13:51:13 GMT
Repository: activemq
Updated Branches:
  refs/heads/master f548aafa8 -> 534dbee44


NO-JIRA: Add test to show behavior of non-prefixed addresses that
default to Queue.

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

Branch: refs/heads/master
Commit: 534dbee4477b3e1ad400e18dfba9541f8da1b5c8
Parents: f548aaf
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Jun 10 09:50:59 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Jun 10 09:50:59 2016 -0400

----------------------------------------------------------------------
 .../amqp/interop/AmqpSendReceiveTest.java       | 66 ++++++++++++++++++++
 1 file changed, 66 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/534dbee4/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
index b9dda61..e48fef7 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
@@ -300,4 +300,70 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         sender.close();
         connection.close();
     }
+
+    @Test(timeout = 60000)
+    public void testSendMessageToQueueNoPrefixReceiveWithPrefix() throws Exception {
+        AmqpClient client = createAmqpClient();
+        AmqpConnection connection = client.connect();
+        AmqpSession session = connection.createSession();
+
+        AmqpSender sender = session.createSender(getTestName());
+        AmqpMessage message = new AmqpMessage();
+
+        message.setText("Test-Message");
+
+        sender.send(message);
+
+        QueueViewMBean queueView = getProxyToQueue(getTestName());
+        assertEquals(1, queueView.getQueueSize());
+        sender.close();
+
+        AmqpReceiver receiver = session.createReceiver("queue://" + getTestName());
+
+        assertEquals(1, queueView.getQueueSize());
+        assertEquals(0, queueView.getDispatchCount());
+
+        receiver.flow(1);
+        AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS);
+        assertNotNull(received);
+        received.accept();
+        receiver.close();
+
+        assertEquals(0, queueView.getQueueSize());
+
+        connection.close();
+    }
+
+    @Test(timeout = 60000)
+    public void testSendMessageToQueueWithPrefixReceiveWithNoPrefix() throws Exception {
+        AmqpClient client = createAmqpClient();
+        AmqpConnection connection = client.connect();
+        AmqpSession session = connection.createSession();
+
+        AmqpSender sender = session.createSender("queue://" + getTestName());
+        AmqpMessage message = new AmqpMessage();
+
+        message.setText("Test-Message");
+
+        sender.send(message);
+
+        QueueViewMBean queueView = getProxyToQueue(getTestName());
+        assertEquals(1, queueView.getQueueSize());
+        sender.close();
+
+        AmqpReceiver receiver = session.createReceiver(getTestName());
+
+        assertEquals(1, queueView.getQueueSize());
+        assertEquals(0, queueView.getDispatchCount());
+
+        receiver.flow(1);
+        AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS);
+        assertNotNull(received);
+        received.accept();
+        receiver.close();
+
+        assertEquals(0, queueView.getQueueSize());
+
+        connection.close();
+    }
 }


Mime
View raw message