You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2014/09/25 16:22:16 UTC
[2/2] git commit: Add tests for the address set methods.
Add tests for the address set methods.
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/148e1b9e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/148e1b9e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/148e1b9e
Branch: refs/heads/master
Commit: 148e1b9e954a28c67f92c16ff4c1d0ce15c16429
Parents: 5bf646c
Author: Timothy Bish <ta...@gmail.com>
Authored: Thu Sep 25 10:21:58 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Thu Sep 25 10:21:58 2014 -0400
----------------------------------------------------------------------
.../amqp/message/AmqpDestinationHelperTest.java | 100 ++++++++++++++++++-
1 file changed, 98 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/148e1b9e/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java
index 8fff0d8..6564583 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java
@@ -322,9 +322,105 @@ public class AmqpDestinationHelperTest {
assertEquals(testAddress, destination.getName());
}
- //--------------- Test setToAddress method -------------------------------//
+ //--------------- Test setToAddressFromDestination method ----------------//
- //--------------- Test setReplyToAddress method --------------------------//
+ @Test
+ public void testSetToAddressFromDestinationWithQueue() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsQueue("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, QUEUE_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetToAddressFromDestinationWithTopic() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTopic("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TOPIC_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetToAddressFromDestinationWithTempQueue() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTemporaryQueue("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TEMP_QUEUE_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetToAddressFromDestinationWithTempTopic() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTemporaryTopic("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TEMP_TOPIC_ATTRIBUTES_STRING);
+ }
+
+ //--------------- Test setReplyToAddressFromDestination method -----------//
+
+ @Test
+ public void testSetReplyToAddressFromDestinationWithQueue() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsQueue("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setReplyToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setReplyToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, QUEUE_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetReplyToAddressFromDestinationWithTopic() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTopic("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setReplyToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setReplyToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TOPIC_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetReplyToAddressFromDestinationWithTempQueue() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTemporaryQueue("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setReplyToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setReplyToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TEMP_QUEUE_ATTRIBUTES_STRING);
+ }
+
+ @Test
+ public void testSetReplyToAddressFromDestinationWithTempTopic() {
+ String testAddress = "testAddress";
+ JmsDestination destination = new JmsTemporaryTopic("testAddress");
+ AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class);
+
+ helper.setReplyToAddressFromDestination(message, destination);
+
+ Mockito.verify(message).setReplyToAddress(testAddress);
+ Mockito.verify(message).setAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME, TEMP_TOPIC_ATTRIBUTES_STRING);
+ }
//--------------- Test Support Methods -----------------------------------//
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org