qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject svn commit: r979201 - in /qpid/trunk/qpid/java: client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
Date Mon, 26 Jul 2010 08:52:31 GMT
Author: grkvlt
Date: Mon Jul 26 08:52:31 2010
New Revision: 979201

URL: http://svn.apache.org/viewvc?rev=979201&view=rev
Log:
QPID-2744: Make 0-10 code path throw a MessageFormatException on null setObjectProperty

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java?rev=979201&r1=979200&r2=979201&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
(original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
Mon Jul 26 08:52:31 2010
@@ -731,7 +731,11 @@ public class AMQMessageDelegate_0_10 ext
     {
         checkPropertyName(propertyName);
         checkWritableProperties();
-        if (object != null && !ALLOWED.contains(object.getClass()))
+        if (object == null)
+        {
+            throw new MessageFormatException("Object is null");            
+        }
+        else if (!ALLOWED.contains(object.getClass()))
         {
             throw new MessageFormatException
                 (String.format

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java?rev=979201&r1=979200&r2=979201&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
Mon Jul 26 08:52:31 2010
@@ -99,19 +99,8 @@ public class JMSPropertiesTest extends Q
         }
         catch (MessageFormatException mfe)
         {
-            // Check the cause
-            Throwable cause = mfe.getCause();
-            assertNotNull(cause);
-            assertEquals("Incorrect cause ", AMQPInvalidClassException.class, cause.getClass());
-            assertEquals("Null values are not allowed to be set",
-                         "Only Primitives objects allowed Object is:null", cause.getMessage());
-
-            // Also check the linked exception
-            cause = mfe.getLinkedException();
-            assertNotNull(cause);
-            assertEquals("Incorrect cause ", AMQPInvalidClassException.class, cause.getClass());
-            assertEquals("Null values are not allowed to be set",
-                         "Only Primitives objects allowed Object is:null", cause.getMessage());
+            // Check the error message
+            assertTrue("Incorrect error message: " + mfe.getMessage(), mfe.getMessage().contains("Object
is null"));
         }
 
         // send it



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message