qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [2/2] git commit: Add tests for some behaviors of onSend
Date Thu, 16 Oct 2014 17:58:49 GMT
Add tests for some behaviors of onSend

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/0b431122
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/0b431122
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/0b431122

Branch: refs/heads/master
Commit: 0b431122506f28145e707822af8f14d0b830f1c3
Parents: 29f2dcd
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Oct 16 13:55:52 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Oct 16 13:55:52 2014 -0400

----------------------------------------------------------------------
 .../amqp/message/AmqpJmsMessageFacadeTest.java     | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/0b431122/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacadeTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacadeTest.java
index 016ad86..1966ced 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacadeTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacadeTest.java
@@ -1855,6 +1855,23 @@ public class AmqpJmsMessageFacadeTest extends AmqpJmsMessageTypesTestCase
 {
     // ===============================================
 
     @Test
+    public void testOnSendWithDisableMessageIdClearsMessageID() throws JMSException {
+        Message message = Mockito.mock(Message.class);
+        JmsMessageFacade amqpMessageFacade = createReceivedMessageFacade(createMockAmqpConsumer(),
message);
+        amqpMessageFacade.onSend(true, false, 0);
+        Mockito.verify(message).setMessageId(null);
+    }
+
+    @Test
+    public void testOnSendWithDisableTimestampClearsTimestamp() throws JMSException {
+        AmqpJmsMessageFacade message = createNewMessageFacade();
+        message.setTimestamp(MAX_UINT);
+        assertEquals(MAX_UINT, message.getTimestamp());
+        message.onSend(false, true, 0);
+        assertEquals(0, message.getTimestamp());
+    }
+
+    @Test
     public void testIsEmpty() {
         AmqpJmsMessageFacade message = createNewMessageFacade();
         assertTrue(message.isEmpty());


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


Mime
View raw message