You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2018/04/30 10:14:22 UTC

qpid-jms git commit: QPIDJMS-381: add the test which showed up the issue

Repository: qpid-jms
Updated Branches:
  refs/heads/master ff1997426 -> ee24047f1


QPIDJMS-381: add the test which showed up the issue


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

Branch: refs/heads/master
Commit: ee24047f17415a10b0997cfd0707ff87402c1303
Parents: ff19974
Author: Robbie Gemmell <ro...@apache.org>
Authored: Mon Apr 30 11:14:07 2018 +0100
Committer: Robbie Gemmell <ro...@apache.org>
Committed: Mon Apr 30 11:14:07 2018 +0100

----------------------------------------------------------------------
 .../qpid/jms/integration/MapMessageIntegrationTest.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/ee24047f/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
index 5cdfffc..49ef18a 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MapMessageIntegrationTest.java
@@ -22,6 +22,7 @@ import static org.hamcrest.Matchers.equalTo;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -101,6 +102,8 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
             short myShort = 25;
             String myStringKey = "myString";
             String myString = myStringKey;
+            String myEmptyStringKey = "myEmtpyString";
+            String myNullStringKey = "myNullString";
 
             Map<String, Object> map = new LinkedHashMap<String, Object>();
             map.put(myBoolKey, myBool);
@@ -113,6 +116,8 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
             map.put(myLongKey, myLong);
             map.put(myShortKey, myShort);
             map.put(myStringKey, myString);
+            map.put(myEmptyStringKey, "");
+            map.put(myNullStringKey, null);
 
             MessageAnnotationsDescribedType msgAnnotations = new MessageAnnotationsDescribedType();
             msgAnnotations.setSymbolKeyedAnnotation(AmqpMessageSupport.JMS_MSG_TYPE, AmqpMessageSupport.JMS_MAP_MESSAGE);
@@ -123,7 +128,6 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
             testPeer.expectReceiverAttach();
             testPeer.expectLinkFlowRespondWithTransfer(null, msgAnnotations, null, null, amqpValueSectionContent);
             testPeer.expectDispositionThatIsAcceptedAndSettled();
-            testPeer.expectClose();
 
             MessageConsumer messageConsumer = session.createConsumer(queue);
             Message receivedMessage = messageConsumer.receive(3000);
@@ -144,6 +148,8 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
             assertEquals("Unexpected long value", myLong, receivedMapMessage.getLong(myLongKey));
             assertEquals("Unexpected short value", myShort, receivedMapMessage.getShort(myShortKey));
             assertEquals("Unexpected UTF value", myString, receivedMapMessage.getString(myStringKey));
+            assertEquals("Unexpected value", "", receivedMapMessage.getString(myEmptyStringKey));
+            assertNull("Unexpected value", receivedMapMessage.getString(myNullStringKey));
 
             assertTrue(receivedMapMessage.isBodyAssignableTo(Map.class));
             assertTrue(receivedMapMessage.isBodyAssignableTo(Object.class));
@@ -158,6 +164,7 @@ public class MapMessageIntegrationTest extends QpidJmsTestCase {
             } catch (MessageFormatException mfe) {
             }
 
+            testPeer.expectClose();
             connection.close();
 
             testPeer.waitForAllHandlersToComplete(3000);


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