diff options
| author | Gordon Sim <gsim@apache.org> | 2007-01-18 08:41:51 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-01-18 08:41:51 +0000 |
| commit | 00e3fdfcfdbc0ca42b7165d3a4bba2bcb4b63480 (patch) | |
| tree | 63c77ad9324689027ec9e9a48d2fa6094a507bc9 /java/common/src/test | |
| parent | f1e00165dd741c383bca69c448898bab4a7ce814 (diff) | |
| download | qpid-python-00e3fdfcfdbc0ca42b7165d3a4bba2bcb4b63480.tar.gz | |
* 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
Diffstat (limited to 'java/common/src/test')
| -rw-r--r-- | java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java | 7 |
1 files changed, 3 insertions, 4 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 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'); |
