diff options
Diffstat (limited to 'java/common/src/test')
-rw-r--r-- | java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java index 007da7423e..66ca43c145 100644 --- a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java +++ b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java @@ -25,6 +25,7 @@ import junit.framework.TestCase; import org.apache.mina.common.ByteBuffer; +import org.apache.qpid.AMQInvalidArgumentException; import org.apache.qpid.AMQPInvalidClassException; import org.slf4j.Logger; @@ -520,6 +521,18 @@ public class PropertyFieldTableTest extends TestCase table.setObject("object-short", Short.MAX_VALUE); table.setObject("object-string", "Hello"); + try + { + table.setObject("Null-object", null); + fail("null values are not allowed"); + } + catch (AMQPInvalidClassException aice) + { + assertEquals("Null values are not allowed to be set", + "Only Primitives objects allowed Object is:null", aice.getMessage()); + } + + Assert.assertEquals((Boolean) true, table.getBoolean("bool")); Assert.assertEquals((Byte) Byte.MAX_VALUE, table.getByte("byte")); assertBytesEqual(bytes, table.getBytes("bytes")); |