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/10/09 00:58:24 UTC

[1/5] git commit: Add test for copy()

Repository: qpid-jms
Updated Branches:
  refs/heads/master 459893d36 -> 5d6fc111f


Add test for copy()

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

Branch: refs/heads/master
Commit: 4cc4debd6c0f88f1f2dcb82ea765de7fd6af1412
Parents: 459893d
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 8 18:28:38 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 8 18:28:38 2014 -0400

----------------------------------------------------------------------
 .../amqp/message/AmqpJmsMapMessageFacadeTest.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4cc4debd/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
index 3475dcf..9d37241 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
@@ -123,6 +123,21 @@ public class AmqpJmsMapMessageFacadeTest extends QpidJmsTestCase {
         assertTrue(amqpMapMessageFacade.isEmpty());
     }
 
+    @Test
+    public void testMessageCopy() throws Exception {
+        AmqpJmsMapMessageFacade amqpMapMessageFacade = createNewMapMessageFacade();
+        amqpMapMessageFacade.put("entry1", "value1");
+        amqpMapMessageFacade.put("entry2", "value2");
+        amqpMapMessageFacade.put("entry3", "value3");
+
+        AmqpJmsMapMessageFacade copy = amqpMapMessageFacade.copy();
+        assertTrue(copy.getMapNames().hasMoreElements());
+
+        assertTrue(copy.itemExists("entry1"));
+        assertTrue(copy.itemExists("entry2"));
+        assertTrue(copy.itemExists("entry3"));
+    }
+
     // ---------- test handling of received messages -------------------------//
 
     @Test


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


[4/5] git commit: Fix isEmpty()

Posted by ta...@apache.org.
Fix isEmpty()

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

Branch: refs/heads/master
Commit: 3780502243d99c826685ff6033eecfb2ae9a3769
Parents: fe1114d
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 8 18:46:09 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 8 18:46:09 2014 -0400

----------------------------------------------------------------------
 .../provider/amqp/message/AmqpJmsTextMessageFacade.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/37805022/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacade.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacade.java
index a7a55cd..e1da812 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacade.java
@@ -145,6 +145,16 @@ public class AmqpJmsTextMessageFacade extends AmqpJmsMessageFacade implements Jm
 
         if (body == null) {
             return true;
+        } else if (body instanceof AmqpValue) {
+            AmqpValue value = (AmqpValue) body;
+            if (value.getValue() == null) {
+                return true;
+            } else {
+                String text = (String) value.getValue();
+                if (text.isEmpty()) {
+                    return true;
+                }
+            }
         } else if (body instanceof Data) {
             Data data = (Data) body;
             if (data.getValue() == null || data.getValue().getLength() == 0) {


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


[5/5] git commit: Start of AmqpJmsTextMessageFacadeTest

Posted by ta...@apache.org.
Start of AmqpJmsTextMessageFacadeTest

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

Branch: refs/heads/master
Commit: 5d6fc111fb5676c580f185ee859fcb7520d389ff
Parents: 3780502
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 8 18:54:49 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 8 18:54:49 2014 -0400

----------------------------------------------------------------------
 .../message/AmqpJmsTextMessageFacadeTest.java   | 129 +++++++++++++++++++
 1 file changed, 129 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5d6fc111/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacadeTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacadeTest.java
new file mode 100644
index 0000000..3fbe30e
--- /dev/null
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsTextMessageFacadeTest.java
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.qpid.jms.provider.amqp.message;
+
+import static org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport.JMS_MSG_TYPE;
+import static org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport.JMS_TEXT_MESSAGE;
+import static org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport.getSymbol;
+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 java.util.Map;
+
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.messaging.AmqpValue;
+import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
+import org.apache.qpid.proton.message.Message;
+import org.junit.Test;
+
+/**
+ * Tests for class AmqpJmsTextMessageFacade
+ */
+public class AmqpJmsTextMessageFacadeTest extends AmqpJmsMessageTypesTestCase {
+
+    //---------- Test initial state of newly created message -----------------//
+
+    @Test
+    public void testNewMessageToSendContainsMessageTypeAnnotation() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+
+        Message protonMessage = amqpTextMessageFacade.getAmqpMessage();
+        MessageAnnotations annotations = protonMessage.getMessageAnnotations();
+        Map<Symbol, Object> annotationsMap = annotations.getValue();
+
+        assertNotNull("MessageAnnotations section was not present", annotations);
+        assertNotNull("MessageAnnotations section value was not present", annotationsMap);
+
+        assertTrue("expected message type annotation to be present", annotationsMap.containsKey(AmqpMessageSupport.getSymbol(JMS_MSG_TYPE)));
+        assertEquals("unexpected value for message type annotation value", JMS_TEXT_MESSAGE, annotationsMap.get(getSymbol(JMS_MSG_TYPE)));
+        assertEquals(JMS_TEXT_MESSAGE, amqpTextMessageFacade.getJmsMsgType());
+    }
+
+    @Test
+    public void testNewMessageToSendClearBodyDoesNotFail() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+        amqpTextMessageFacade.clearBody();
+    }
+
+    @Test
+    public void testNewMessageToSendReportsIsEmpty() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+        amqpTextMessageFacade.clearBody();
+        assertTrue(amqpTextMessageFacade.isEmpty());
+    }
+
+    @Test
+    public void testNewMessageToSendReturnsNullText() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+        amqpTextMessageFacade.clearBody();
+        assertNull(amqpTextMessageFacade.getText());
+    }
+
+    // ---------- test for normal message operations -------------------------//
+
+    @Test
+    public void testMessageClearBodyWorks() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+        assertTrue(amqpTextMessageFacade.isEmpty());
+        amqpTextMessageFacade.setText("SomeTextForMe");
+        assertFalse(amqpTextMessageFacade.isEmpty());
+        amqpTextMessageFacade.clearBody();
+        assertTrue(amqpTextMessageFacade.isEmpty());
+    }
+
+    @Test
+    public void testMessageCopy() throws Exception {
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
+        amqpTextMessageFacade.setText("SomeTextForMe");
+
+        AmqpJmsTextMessageFacade copy = amqpTextMessageFacade.copy();
+        assertEquals("SomeTextForMe", copy.getText());
+    }
+
+    // ---------- test handling of received messages -------------------------//
+
+    @Test
+    public void testCreateWithEmptyAmqpValue() throws Exception {
+        Message message = Message.Factory.create();
+        message.setBody(new AmqpValue(null));
+
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(), message);
+
+        // Should be able to use the message, e.g clearing it and adding to it.
+        amqpTextMessageFacade.clearBody();
+        amqpTextMessageFacade.setText("TEST");
+        assertEquals("TEST", amqpTextMessageFacade.getText());
+    }
+
+    @Test
+    public void testCreateWithNonEmptyAmqpValue() throws Exception {
+        Message message = Message.Factory.create();
+        message.setBody(new AmqpValue("TEST"));
+
+        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(), message);
+
+        assertEquals("TEST", amqpTextMessageFacade.getText());
+
+        // Should be able to use the message, e.g clearing it and adding to it.
+        amqpTextMessageFacade.clearBody();
+        amqpTextMessageFacade.setText("TEST-CLEARED");
+        assertEquals("TEST-CLEARED", amqpTextMessageFacade.getText());
+    }
+}


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


[3/5] git commit: Break out some common bits into a base class for all the AMQP message facades to use in their test cases.

Posted by ta...@apache.org.
Break out some common bits into a base class for all the AMQP message
facades to use in their test cases.

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

Branch: refs/heads/master
Commit: fe1114d22a61121408b50b641af91c96cd94aa10
Parents: 8c223ae
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 8 18:41:39 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 8 18:41:39 2014 -0400

----------------------------------------------------------------------
 .../message/AmqpJmsMapMessageFacadeTest.java    | 39 +--------
 .../amqp/message/AmqpJmsMessageFacadeTest.java  | 26 +-----
 .../message/AmqpJmsMessageTypesTestCase.java    | 83 ++++++++++++++++++++
 .../message/AmqpJmsStreamMessageFacadeTest.java | 41 +---------
 4 files changed, 87 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/fe1114d2/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
index 9d37241..cc70a0c 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacadeTest.java
@@ -27,33 +27,17 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.qpid.jms.JmsDestination;
-import org.apache.qpid.jms.JmsTopic;
-import org.apache.qpid.jms.provider.amqp.AmqpConnection;
-import org.apache.qpid.jms.provider.amqp.AmqpConsumer;
-import org.apache.qpid.jms.test.QpidJmsTestCase;
 import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
 import org.apache.qpid.proton.amqp.messaging.AmqpValue;
 import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
 import org.apache.qpid.proton.message.Message;
-import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mockito;
 
 /**
  * Test for the AmqpJmsMapMessageFacade class
  */
-public class AmqpJmsMapMessageFacadeTest extends QpidJmsTestCase {
-
-    private JmsDestination consumerDestination;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        consumerDestination = new JmsTopic("TestTopic");
-    };
+public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase {
 
     //---------- Test initial state of newly created message -----------------//
 
@@ -225,25 +209,4 @@ public class AmqpJmsMapMessageFacadeTest extends QpidJmsTestCase {
         amqpMapMessageFacade.put("entry", "value");
         assertFalse(amqpMapMessageFacade.isEmpty());
     }
-
-    //---------- Test Support Methods ----------------------------------------//
-
-    private AmqpJmsMapMessageFacade createNewMapMessageFacade() {
-        return new AmqpJmsMapMessageFacade(createMockAmqpConnection());
-    }
-
-    private AmqpJmsMapMessageFacade createReceivedMapMessageFacade(AmqpConsumer amqpConsumer, Message message) {
-        return new AmqpJmsMapMessageFacade(amqpConsumer, message);
-    }
-
-    private AmqpConsumer createMockAmqpConsumer() {
-        AmqpConsumer consumer = Mockito.mock(AmqpConsumer.class);
-        Mockito.when(consumer.getConnection()).thenReturn(createMockAmqpConnection());
-        Mockito.when(consumer.getDestination()).thenReturn(consumerDestination);
-        return consumer;
-    }
-
-    private AmqpConnection createMockAmqpConnection() {
-        return Mockito.mock(AmqpConnection.class);
-    }
 }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/fe1114d2/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 a497e16..250e09f 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
@@ -45,8 +45,6 @@ import org.apache.qpid.jms.JmsQueue;
 import org.apache.qpid.jms.JmsTemporaryQueue;
 import org.apache.qpid.jms.JmsTopic;
 import org.apache.qpid.jms.message.facade.JmsMessageFacade;
-import org.apache.qpid.jms.provider.amqp.AmqpConnection;
-import org.apache.qpid.jms.provider.amqp.AmqpConsumer;
 import org.apache.qpid.jms.test.testpeer.describedtypes.sections.PropertiesDescribedType;
 import org.apache.qpid.proton.Proton;
 import org.apache.qpid.proton.amqp.Binary;
@@ -61,34 +59,14 @@ import org.apache.qpid.proton.amqp.messaging.Properties;
 import org.apache.qpid.proton.codec.impl.DataImpl;
 import org.apache.qpid.proton.message.Message;
 import org.junit.Test;
-import org.mockito.Mockito;
 
-public class AmqpJmsMessageFacadeTest {
+public class AmqpJmsMessageFacadeTest extends AmqpJmsMessageTypesTestCase  {
+
     private static final String TEST_PROP_A = "TEST_PROP_A";
     private static final String TEST_PROP_B = "TEST_PROP_B";
     private static final String TEST_VALUE_STRING_A = "TEST_VALUE_STRING_A";
     private static final String TEST_VALUE_STRING_B = "TEST_VALUE_STRING_B";
     private static final long MAX_UINT = 0xFFFFFFFFL;
-    private final JmsDestination consumerDestination = new JmsTopic("TestTopic");
-
-    private AmqpJmsMessageFacade createNewMessageFacade() {
-        return new AmqpJmsMessageFacade(createMockAmqpConnection());
-    }
-
-    private AmqpJmsMessageFacade createReceivedMessageFacade(AmqpConsumer amqpConsumer, Message message) {
-        return new AmqpJmsMessageFacade(amqpConsumer, message);
-    }
-
-    private AmqpConsumer createMockAmqpConsumer() {
-        AmqpConsumer consumer = Mockito.mock(AmqpConsumer.class);
-        Mockito.when(consumer.getConnection()).thenReturn(createMockAmqpConnection());
-        Mockito.when(consumer.getDestination()).thenReturn(consumerDestination);
-        return consumer;
-    }
-
-    private AmqpConnection createMockAmqpConnection() {
-        return Mockito.mock(AmqpConnection.class);
-    }
 
     // ====== AMQP Header Section =======
     // ==================================

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/fe1114d2/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageTypesTestCase.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageTypesTestCase.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageTypesTestCase.java
new file mode 100644
index 0000000..d4201df
--- /dev/null
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageTypesTestCase.java
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.qpid.jms.provider.amqp.message;
+
+import org.apache.qpid.jms.JmsDestination;
+import org.apache.qpid.jms.JmsTopic;
+import org.apache.qpid.jms.provider.amqp.AmqpConnection;
+import org.apache.qpid.jms.provider.amqp.AmqpConsumer;
+import org.apache.qpid.jms.test.QpidJmsTestCase;
+import org.apache.qpid.proton.message.Message;
+import org.junit.Before;
+import org.mockito.Mockito;
+
+public class AmqpJmsMessageTypesTestCase extends QpidJmsTestCase {
+
+    private JmsDestination consumerDestination;
+
+    @Before
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        consumerDestination = new JmsTopic("TestTopic");
+    };
+
+    //---------- Test Support Methods ----------------------------------------//
+
+    protected AmqpJmsMessageFacade createNewMessageFacade() {
+        return new AmqpJmsMessageFacade(createMockAmqpConnection());
+    }
+
+    protected AmqpJmsMessageFacade createReceivedMessageFacade(AmqpConsumer amqpConsumer, Message message) {
+        return new AmqpJmsMessageFacade(amqpConsumer, message);
+    }
+
+    protected AmqpJmsTextMessageFacade createNewTextMessageFacade() {
+        return new AmqpJmsTextMessageFacade(createMockAmqpConnection());
+    }
+
+    protected AmqpJmsTextMessageFacade createReceivedTextMessageFacade(AmqpConsumer amqpConsumer, Message message) {
+        return new AmqpJmsTextMessageFacade(amqpConsumer, message);
+    }
+
+    protected AmqpJmsMapMessageFacade createNewMapMessageFacade() {
+        return new AmqpJmsMapMessageFacade(createMockAmqpConnection());
+    }
+
+    protected AmqpJmsMapMessageFacade createReceivedMapMessageFacade(AmqpConsumer amqpConsumer, Message message) {
+        return new AmqpJmsMapMessageFacade(amqpConsumer, message);
+    }
+
+    protected AmqpJmsStreamMessageFacade createNewStreamMessageFacade() {
+        return new AmqpJmsStreamMessageFacade(createMockAmqpConnection());
+    }
+
+    protected AmqpJmsStreamMessageFacade createReceivedStreamMessageFacade(AmqpConsumer amqpConsumer, Message message) {
+        return new AmqpJmsStreamMessageFacade(amqpConsumer, message);
+    }
+
+    protected AmqpConsumer createMockAmqpConsumer() {
+        AmqpConsumer consumer = Mockito.mock(AmqpConsumer.class);
+        Mockito.when(consumer.getConnection()).thenReturn(createMockAmqpConnection());
+        Mockito.when(consumer.getDestination()).thenReturn(consumerDestination);
+        return consumer;
+    }
+
+    protected AmqpConnection createMockAmqpConnection() {
+        return Mockito.mock(AmqpConnection.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/fe1114d2/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacadeTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacadeTest.java
index ec0e3bd..e661275 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacadeTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacadeTest.java
@@ -32,11 +32,6 @@ import java.util.Map;
 
 import javax.jms.MessageEOFException;
 
-import org.apache.qpid.jms.JmsDestination;
-import org.apache.qpid.jms.JmsTopic;
-import org.apache.qpid.jms.provider.amqp.AmqpConnection;
-import org.apache.qpid.jms.provider.amqp.AmqpConsumer;
-import org.apache.qpid.jms.test.QpidJmsTestCase;
 import org.apache.qpid.proton.amqp.Binary;
 import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
@@ -45,21 +40,9 @@ import org.apache.qpid.proton.amqp.messaging.Data;
 import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
 import org.apache.qpid.proton.amqp.messaging.Section;
 import org.apache.qpid.proton.message.Message;
-import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mockito;
 
-public class AmqpJmsStreamMessageFacadeTest extends QpidJmsTestCase {
-
-    private JmsDestination consumerDestination;
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-
-        consumerDestination = new JmsTopic("TestTopic");
-    };
+public class AmqpJmsStreamMessageFacadeTest extends AmqpJmsMessageTypesTestCase {
 
     @Test
     public void testNewMessageToSendContainsMessageTypeAnnotation() throws Exception {
@@ -346,26 +329,4 @@ public class AmqpJmsStreamMessageFacadeTest extends QpidJmsTestCase {
         amqpStreamMessageFacade.clearBody();
         amqpStreamMessageFacade.put("myString");
     }
-
-    // ====== Utility Methods =======
-    // ==============================
-
-    private AmqpJmsStreamMessageFacade createNewStreamMessageFacade() {
-        return new AmqpJmsStreamMessageFacade(createMockAmqpConnection());
-    }
-
-    private AmqpJmsStreamMessageFacade createReceivedStreamMessageFacade(AmqpConsumer amqpConsumer, Message message) {
-        return new AmqpJmsStreamMessageFacade(amqpConsumer, message);
-    }
-
-    private AmqpConsumer createMockAmqpConsumer() {
-        AmqpConsumer consumer = Mockito.mock(AmqpConsumer.class);
-        Mockito.when(consumer.getConnection()).thenReturn(createMockAmqpConnection());
-        Mockito.when(consumer.getDestination()).thenReturn(consumerDestination);
-        return consumer;
-    }
-
-    private AmqpConnection createMockAmqpConnection() {
-        return Mockito.mock(AmqpConnection.class);
-    }
 }
\ No newline at end of file


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


[2/5] git commit: Remove unused method.

Posted by ta...@apache.org.
Remove unused method.

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

Branch: refs/heads/master
Commit: 8c223aead601151f0b624d0b83601abdcc5cd60b
Parents: 4cc4deb
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Oct 8 18:40:41 2014 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Oct 8 18:40:41 2014 -0400

----------------------------------------------------------------------
 .../jms/message/facade/defaults/JmsDefaultMessageFacade.java   | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8c223aea/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
index 53a7679..dbc6ce0 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java
@@ -347,10 +347,4 @@ public class JmsDefaultMessageFacade implements JmsMessageFacade {
     public void clearGroupSequence() {
         this.groupSequence = 0;
     }
-
-    private void lazyCreateProperties() {
-        if (properties == null) {
-            properties = new HashMap<String, Object>();
-        }
-    }
 }


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