Repository: qpid-jms Updated Branches: refs/heads/master 38299e760 -> 44d6e320c
Add some additional tests to validate handling null values behaves as expected. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/8063fcb8 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/8063fcb8 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/8063fcb8 Branch: refs/heads/master Commit: 8063fcb88025058147c3c1fa549002d515d2e48b Parents: 38299e7 Author: Timothy Bish <tabish...@gmail.com> Authored: Thu Sep 25 15:38:51 2014 -0400 Committer: Timothy Bish <tabish...@gmail.com> Committed: Thu Sep 25 15:38:51 2014 -0400 ---------------------------------------------------------------------- .../amqp/message/AmqpDestinationHelperTest.java | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8063fcb8/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 6564583..fbd0948 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 @@ -325,6 +325,26 @@ public class AmqpDestinationHelperTest { //--------------- Test setToAddressFromDestination method ----------------// @Test + public void testSetToAddressFromDestinationWithNullDestination() { + AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); + helper.setToAddressFromDestination(message, null); + Mockito.verifyZeroInteractions(message); + } + + @Test + public void testSetToAddressFromDestinationWithNullDestinationAndNullMessage() { + AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); + helper.setToAddressFromDestination(null, null); + Mockito.verifyZeroInteractions(message); + } + + @Test(expected=NullPointerException.class) + public void testSetToAddressFromDestinationWithNullMessage() { + JmsDestination destination = new JmsQueue("testAddress"); + helper.setToAddressFromDestination(null, destination); + } + + @Test public void testSetToAddressFromDestinationWithQueue() { String testAddress = "testAddress"; JmsDestination destination = new JmsQueue("testAddress"); @@ -375,6 +395,26 @@ public class AmqpDestinationHelperTest { //--------------- Test setReplyToAddressFromDestination method -----------// @Test + public void testSetReplyToAddressFromDestinationWithNullDestination() { + AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); + helper.setReplyToAddressFromDestination(message, null); + Mockito.verifyZeroInteractions(message); + } + + @Test + public void testSetReplyToAddressFromDestinationWithNullDestinationAndNullMessage() { + AmqpJmsMessageFacade message = Mockito.mock(AmqpJmsMessageFacade.class); + helper.setReplyToAddressFromDestination(null, null); + Mockito.verifyZeroInteractions(message); + } + + @Test(expected=NullPointerException.class) + public void testSetReplyToAddressFromDestinationWithNullMessage() { + JmsDestination destination = new JmsQueue("testAddress"); + helper.setReplyToAddressFromDestination(null, destination); + } + + @Test public void testSetReplyToAddressFromDestinationWithQueue() { String testAddress = "testAddress"; JmsDestination destination = new JmsQueue("testAddress"); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org