From 00e3fdfcfdbc0ca42b7165d3a4bba2bcb4b63480 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 18 Jan 2007 08:41:51 +0000 Subject: * uses LONG_STRING in place of WIDE_STRING for properties set through FieldTable.setString() as these appear to all be equivalent (apart from the type code) * uses setString instead of setAsciiString in creation of the connection.start-ok frames client properties * uses 4 bytes for the size of the BINARY value type as per the spec posted on the wiki git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@497352 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/java/org/apache/qpid/framing/PropertyFieldTableTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'java/common/src/test') 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 e0692594c7..6160dc1843 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 @@ -528,8 +528,7 @@ public class PropertyFieldTableTest extends TestCase table.setString("string", "hello"); table.setString("null-string", null); - - final ByteBuffer buffer = ByteBuffer.allocate((int) table.getEncodedSize()); // FIXME XXX: Is cast a problem? + final ByteBuffer buffer = ByteBuffer.allocate((int) table.getEncodedSize() + 4); // FIXME XXX: Is cast a problem? table.writeToBuffer(buffer); @@ -579,7 +578,7 @@ public class PropertyFieldTableTest extends TestCase byte[] _bytes = {99, 98, 97, 96, 95}; result.setBytes("bytes", _bytes); - size += 1 + EncodingUtils.encodedShortStringLength("bytes") + 1 + EncodingUtils.encodedByteLength() * _bytes.length; + size += 1 + EncodingUtils.encodedShortStringLength("bytes") + 4 + _bytes.length; Assert.assertEquals(size, result.getEncodedSize()); result.setChar("char", (char) 'c'); @@ -621,7 +620,7 @@ public class PropertyFieldTableTest extends TestCase Assert.assertEquals(size, result.getEncodedSize()); result.setObject("object-bytes", _bytes); - size += 1 + EncodingUtils.encodedShortStringLength("object-bytes") + 1 + EncodingUtils.encodedByteLength() * _bytes.length; + size += 1 + EncodingUtils.encodedShortStringLength("object-bytes") + 4 + _bytes.length; Assert.assertEquals(size, result.getEncodedSize()); result.setObject("object-char", 'c'); -- cgit v1.2.1