qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [2/3] qpid-jms git commit: NO-JIRA: remove test-only 'isEmpty' method
Date Wed, 27 May 2015 14:22:54 GMT
NO-JIRA: remove test-only 'isEmpty' 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/be5e8512
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/be5e8512
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/be5e8512

Branch: refs/heads/master
Commit: be5e85128c104e09c7ddb77edc53fd6990f275be
Parents: 7a31994
Author: Robert Gemmell <robbie@apache.org>
Authored: Tue May 26 12:50:53 2015 +0100
Committer: Robert Gemmell <robbie@apache.org>
Committed: Wed May 27 15:22:37 2015 +0100

----------------------------------------------------------------------
 .../jms/message/facade/JmsMessageFacade.java    |  8 --
 .../amqp/message/AmqpJmsBytesMessageFacade.java |  5 --
 .../amqp/message/AmqpJmsMapMessageFacade.java   |  5 --
 .../amqp/message/AmqpJmsMessageFacade.java      |  5 --
 .../message/AmqpJmsObjectMessageFacade.java     |  6 --
 .../message/AmqpJmsStreamMessageFacade.java     |  5 --
 .../amqp/message/AmqpJmsTextMessageFacade.java  | 28 -------
 .../qpid/jms/message/JmsMapMessageTest.java     |  1 -
 .../defaults/JmsDefaultBytesMessageFacade.java  |  9 ---
 .../defaults/JmsDefaultMessageFacade.java       |  5 --
 .../defaults/JmsDefaultObjectMessageFacade.java | 10 +--
 .../defaults/JmsDefaultTextMessageFacade.java   |  5 --
 .../message/AmqpJmsBytesMessageFacadeTest.java  | 20 -----
 .../message/AmqpJmsMapMessageFacadeTest.java    | 14 ++--
 .../amqp/message/AmqpJmsMessageFacadeTest.java  |  6 --
 .../amqp/message/AmqpJmsMessageFactoryTest.java |  6 +-
 .../message/AmqpJmsStreamMessageFacadeTest.java | 12 ---
 .../message/AmqpJmsTextMessageFacadeTest.java   | 78 +-------------------
 18 files changed, 15 insertions(+), 213 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
index 34079cb..a7b1715 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java
@@ -106,14 +106,6 @@ public interface JmsMessageFacade {
     void onDispatch() throws JMSException;
 
     /**
-     * This method should provide a quick check on the message to determine if
-     * there is any content actually contained within.
-     *
-     * @return true if the message content is non-empty.
-     */
-    boolean isEmpty();
-
-    /**
      * Clears the contents of this Message.
      */
     void clearBody();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacade.java
index 2da69e7..143f8d5 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacade.java
@@ -102,11 +102,6 @@ public class AmqpJmsBytesMessageFacade extends AmqpJmsMessageFacade implements
J
     }
 
     @Override
-    public boolean isEmpty() {
-        return getBinaryFromBody().getLength() == 0;
-    }
-
-    @Override
     public void clearBody() {
         if (bytesIn != null) {
             try {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacade.java
index d462c18..786087d 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMapMessageFacade.java
@@ -110,11 +110,6 @@ public class AmqpJmsMapMessageFacade extends AmqpJmsMessageFacade implements
Jms
     }
 
     @Override
-    public boolean isEmpty() {
-        return messageBodyMap.isEmpty();
-    }
-
-    @Override
     public Object get(String key) {
         Object value = messageBodyMap.get(key);
         if (value instanceof Binary) {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
index cca2683..090e775 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java
@@ -142,11 +142,6 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade {
     }
 
     @Override
-    public boolean isEmpty() {
-        return true;
-    }
-
-    @Override
     public boolean propertyExists(String key) throws JMSException {
         return AmqpJmsMessagePropertyIntercepter.propertyExists(this, key);
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
index 205453b..cedaa80 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsObjectMessageFacade.java
@@ -77,12 +77,6 @@ public class AmqpJmsObjectMessageFacade extends AmqpJmsMessageFacade implements
         return JMS_OBJECT_MESSAGE;
     }
 
-    @Override
-    public boolean isEmpty() {
-        // TODO - If null body changes to empty AmqpValue this needs to also change.
-        return getAmqpMessage().getBody() == null;
-    }
-
     public boolean isAmqpTypedEncoding() {
         return delegate.isAmqpTypeEncoded();
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacade.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacade.java
index 8e5fa04..8cd6dc0 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacade.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsStreamMessageFacade.java
@@ -161,11 +161,6 @@ public class AmqpJmsStreamMessageFacade extends AmqpJmsMessageFacade
implements
         position = 0;
     }
 
-    @Override
-    public boolean isEmpty() {
-        return list.isEmpty();
-    }
-
     private List<Object> initializeEmptyBodyList(boolean useSequenceBody) {
         List<Object> emptyList = new ArrayList<Object>();
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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 214e144..79447ae 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
@@ -135,34 +135,6 @@ public class AmqpJmsTextMessageFacade extends AmqpJmsMessageFacade implements
Jm
         setText(null);
     }
 
-    @Override
-    public boolean isEmpty() {
-        Section body = getAmqpMessage().getBody();
-
-        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) {
-                return true;
-            }
-        } else {
-            return true;  // This should never happen but report empty in case
-        }
-
-        return false;
-    }
-
     Charset getCharset() {
         return charset;
     }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
index 75e8d46..e94dbc3 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/JmsMapMessageTest.java
@@ -160,7 +160,6 @@ public class JmsMapMessageTest {
 
         assertTrue("key should exist: " + myKey1, mapMessage.itemExists(myKey1));
         mapMessage.clearBody();
-        assertTrue("expected map to be emptied", facade.isEmpty());
         assertFalse("key should not exist", mapMessage.itemExists(myKey1));
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultBytesMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultBytesMessageFacade.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultBytesMessageFacade.java
index f647b43..2ff009f 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultBytesMessageFacade.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultBytesMessageFacade.java
@@ -64,15 +64,6 @@ public final class JmsDefaultBytesMessageFacade extends JmsDefaultMessageFacade
     }
 
     @Override
-    public boolean isEmpty() {
-        if (content == null || content.readableBytes() == 0) {
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
     public void clearBody() {
         if (bytesIn != null) {
             try {

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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 66f0321..c384b25 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
@@ -136,11 +136,6 @@ public class JmsDefaultMessageFacade implements JmsMessageFacade {
     }
 
     @Override
-    public boolean isEmpty() {
-        return true;
-    }
-
-    @Override
     public void clearBody() {
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultObjectMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultObjectMessageFacade.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultObjectMessageFacade.java
index f9bf220..04608b8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultObjectMessageFacade.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultObjectMessageFacade.java
@@ -47,15 +47,10 @@ public class JmsDefaultObjectMessageFacade extends JmsDefaultMessageFacade
imple
     }
 
     @Override
-    public boolean isEmpty() {
-        return object == null || object.length == 0;
-    }
-
-    @Override
     public JmsDefaultObjectMessageFacade copy() {
         JmsDefaultObjectMessageFacade copy = new JmsDefaultObjectMessageFacade();
         copyInto(copy);
-        if (!isEmpty()) {
+        if (object != null) {
             copy.object = Arrays.copyOf(object, object.length);
         }
 
@@ -69,8 +64,7 @@ public class JmsDefaultObjectMessageFacade extends JmsDefaultMessageFacade
imple
 
     @Override
     public Serializable getObject() throws IOException, ClassNotFoundException {
-
-        if (isEmpty()) {
+        if (object == null) {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultTextMessageFacade.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultTextMessageFacade.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultTextMessageFacade.java
index c21d5c1..2d56c84 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultTextMessageFacade.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultTextMessageFacade.java
@@ -31,11 +31,6 @@ public final class JmsDefaultTextMessageFacade extends JmsDefaultMessageFacade
i
     }
 
     @Override
-    public boolean isEmpty() {
-        return text != null && !text.isEmpty();
-    }
-
-    @Override
     public JmsDefaultTextMessageFacade copy() {
         JmsDefaultTextMessageFacade copy = new JmsDefaultTextMessageFacade();
         copyInto(copy);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacadeTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacadeTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacadeTest.java
index fd110ee..620c3b8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacadeTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsBytesMessageFacadeTest.java
@@ -273,7 +273,6 @@ public class AmqpJmsBytesMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(),
message);
 
         assertEquals("Message reports unexpected length", length, amqpBytesMessageFacade.getBodyLength());
-        assertFalse(amqpBytesMessageFacade.isEmpty());
     }
 
     @Test
@@ -293,7 +292,6 @@ public class AmqpJmsBytesMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(),
message);
 
         assertEquals("Message reports unexpected length", 0, amqpBytesMessageFacade.getBodyLength());
-        assertTrue(amqpBytesMessageFacade.isEmpty());
     }
 
     @Test
@@ -399,24 +397,6 @@ public class AmqpJmsBytesMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         }
     }
 
-    @Test
-    public void testIsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new Data(new Binary(new byte[1])));
-        AmqpJmsBytesMessageFacade amqpBytesMessageFacade = createReceivedBytesMessageFacade(createMockAmqpConsumer(),
message);
-
-        // Very small payload.
-        assertFalse(amqpBytesMessageFacade.isEmpty());
-
-        // Ensure no NPE
-        message.setBody(null);
-        assertTrue(amqpBytesMessageFacade.isEmpty());
-
-        byte[] bytes = "myBytes".getBytes();
-        message.setBody(new AmqpValue(new Binary(bytes)));
-        assertFalse(amqpBytesMessageFacade.isEmpty());
-    }
-
     /**
      * Test that setting bytes on a received message results in the expected content in the
body section
      * of the underlying message and returned by a new InputStream requested from the message.

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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 cc70a0c..e3bff5b 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
@@ -65,7 +65,7 @@ public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
     @Test
     public void testNewMessageToSendReportsIsEmpty() throws Exception {
         AmqpJmsMapMessageFacade amqpMapMessageFacade = createNewMapMessageFacade();
-        assertTrue(amqpMapMessageFacade.isEmpty());
+        assertFalse(amqpMapMessageFacade.getMapNames().hasMoreElements());
     }
 
     @Test
@@ -100,11 +100,11 @@ public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
     @Test
     public void testMessageClearBodyWorks() throws Exception {
         AmqpJmsMapMessageFacade amqpMapMessageFacade = createNewMapMessageFacade();
-        assertTrue(amqpMapMessageFacade.isEmpty());
+        assertFalse(amqpMapMessageFacade.getMapNames().hasMoreElements());
         amqpMapMessageFacade.put("entry", "value");
-        assertFalse(amqpMapMessageFacade.isEmpty());
+        assertTrue(amqpMapMessageFacade.getMapNames().hasMoreElements());
         amqpMapMessageFacade.clearBody();
-        assertTrue(amqpMapMessageFacade.isEmpty());
+        assertFalse(amqpMapMessageFacade.getMapNames().hasMoreElements());
     }
 
     @Test
@@ -148,7 +148,7 @@ public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         AmqpJmsMapMessageFacade amqpMapMessageFacade = createReceivedMapMessageFacade(createMockAmqpConsumer(),
message);
 
         // Data should be preserved
-        assertFalse(amqpMapMessageFacade.isEmpty());
+        assertTrue(amqpMapMessageFacade.getMapNames().hasMoreElements());
         Object result = amqpMapMessageFacade.get("entry1");
         assertNotNull(result);
         assertTrue(result instanceof Boolean);
@@ -194,7 +194,7 @@ public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         // Should be able to use the message, e.g clearing it and adding to it.
         amqpMapMessageFacade.clearBody();
         amqpMapMessageFacade.put("entry", "value");
-        assertFalse(amqpMapMessageFacade.isEmpty());
+        assertTrue(amqpMapMessageFacade.getMapNames().hasMoreElements());
     }
 
     @Test
@@ -207,6 +207,6 @@ public class AmqpJmsMapMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
         // Should be able to use the message, e.g clearing it and adding to it.
         amqpMapMessageFacade.clearBody();
         amqpMapMessageFacade.put("entry", "value");
-        assertFalse(amqpMapMessageFacade.isEmpty());
+        assertTrue(amqpMapMessageFacade.getMapNames().hasMoreElements());
     }
 }

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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 6c364c9..42ae17e 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
@@ -1865,12 +1865,6 @@ public class AmqpJmsMessageFacadeTest extends AmqpJmsMessageTypesTestCase
 {
     }
 
     @Test
-    public void testIsEmpty() {
-        AmqpJmsMessageFacade message = createNewMessageFacade();
-        assertTrue(message.isEmpty());
-    }
-
-    @Test
     public void testClearBodyRemoveMessageBody() {
         Message message = Mockito.mock(Message.class);
         JmsMessageFacade amqpMessageFacade = createReceivedMessageFacade(createMockAmqpConsumer(),
message);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFactoryTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFactoryTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFactoryTest.java
index 70d8fd0..37a27ba 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFactoryTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFactoryTest.java
@@ -108,7 +108,7 @@ public class AmqpJmsMessageFactoryTest extends QpidJmsTestCase {
         AmqpJmsBytesMessageFacade amqpMessage = (AmqpJmsBytesMessageFacade) facade;
 
         assertEquals(JMS_BYTES_MESSAGE, amqpMessage.getJmsMsgType());
-        assertTrue(amqpMessage.isEmpty());
+        assertEquals(0, amqpMessage.getBodyLength());
     }
 
     @Test
@@ -120,7 +120,7 @@ public class AmqpJmsMessageFactoryTest extends QpidJmsTestCase {
         AmqpJmsMapMessageFacade amqpMessage = (AmqpJmsMapMessageFacade) facade;
 
         assertEquals(JMS_MAP_MESSAGE, amqpMessage.getJmsMsgType());
-        assertTrue(amqpMessage.isEmpty());
+        assertFalse(amqpMessage.getMapNames().hasMoreElements());
     }
 
     @Test
@@ -132,7 +132,7 @@ public class AmqpJmsMessageFactoryTest extends QpidJmsTestCase {
         AmqpJmsStreamMessageFacade amqpMessage = (AmqpJmsStreamMessageFacade) facade;
 
         assertEquals(JMS_STREAM_MESSAGE, amqpMessage.getJmsMsgType());
-        assertTrue(amqpMessage.isEmpty());
+        assertFalse(amqpMessage.hasNext());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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 e661275..fa7272b 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
@@ -187,18 +187,6 @@ public class AmqpJmsStreamMessageFacadeTest extends AmqpJmsMessageTypesTestCase
     }
 
     @Test
-    public void testIsEmpty() throws Exception {
-        AmqpJmsStreamMessageFacade amqpStreamMessageFacade = createNewStreamMessageFacade();
-
-        assertTrue("unexpected value", amqpStreamMessageFacade.isEmpty());
-
-        // add something
-        amqpStreamMessageFacade.put(Boolean.TRUE);
-
-        assertFalse("unexpected value", amqpStreamMessageFacade.isEmpty());
-    }
-
-    @Test
     public void testHasNext() throws Exception {
         AmqpJmsStreamMessageFacade amqpStreamMessageFacade = createNewStreamMessageFacade();
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/be5e8512/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
index e4169eb..c86f41a 100644
--- 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
@@ -73,78 +73,6 @@ public class AmqpJmsTextMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
     }
 
     @Test
-    public void testNewMessageToSendReportsIsEmpty() throws Exception {
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
-        amqpTextMessageFacade.clearBody();
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithNullBodyRetportsIsEmpty() throws Exception {
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
-        amqpTextMessageFacade.getAmqpMessage().setBody(null);
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testIsEmptyUsingReceivedMessageWithZeroLengthDataSection() throws Exception
{
-        org.apache.qpid.proton.codec.Data payloadData = new DataImpl();
-        payloadData.putDescribedType(new DataDescribedType(new Binary(new byte[0])));
-        Binary b = payloadData.encode();
-
-        Message message = Message.Factory.create();
-        int decoded = message.decode(b.getArray(), b.getArrayOffset(), b.getLength());
-        assertEquals(decoded, b.getLength());
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithEmptyDataRetportsIsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new Data(null));
-
-        // This shouldn't happen with actual received messages, since Data sections can't
really
-        // have a null value in them, they would have an empty byte array, but just in case...
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithEmptyDataBinaryRetportsIsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new Data(new Binary(new byte[0])));
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithNonEmptyDataBinaryRetportsIsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new Data(new Binary(new byte[1])));
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-        assertFalse(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithEmptyAmqpValueStringRetportsIsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new AmqpValue(""));
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
-    public void testMessageWithUnexpectedContentsReturnsEmpty() throws Exception {
-        Message message = Message.Factory.create();
-        message.setBody(new AmqpSequence(null));
-        AmqpJmsTextMessageFacade amqpTextMessageFacade = createReceivedTextMessageFacade(createMockAmqpConsumer(),
message);
-        assertTrue(amqpTextMessageFacade.isEmpty());
-    }
-
-    @Test
     public void testNewMessageToSendReturnsNullText() throws Exception {
         AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
         amqpTextMessageFacade.clearBody();
@@ -156,11 +84,11 @@ public class AmqpJmsTextMessageFacadeTest extends AmqpJmsMessageTypesTestCase
{
     @Test
     public void testMessageClearBodyWorks() throws Exception {
         AmqpJmsTextMessageFacade amqpTextMessageFacade = createNewTextMessageFacade();
-        assertTrue(amqpTextMessageFacade.isEmpty());
+        assertNull(amqpTextMessageFacade.getText());
         amqpTextMessageFacade.setText("SomeTextForMe");
-        assertFalse(amqpTextMessageFacade.isEmpty());
+        assertNotNull(amqpTextMessageFacade.getText());
         amqpTextMessageFacade.clearBody();
-        assertTrue(amqpTextMessageFacade.isEmpty());
+        assertNull(amqpTextMessageFacade.getText());
     }
 
     @Test


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


Mime
View raw message