From 56cb59d88b24662168d8988d3fac5ef0557149fa Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Mon, 26 Jul 2010 14:09:03 +0000 Subject: QPID-2660: Remove AMQFrameDecodingException git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@979291 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/framing/FieldTable.java | 4 +-- .../qpid/framing/PropertyFieldTableTest.java | 35 ++++++++-------------- 2 files changed, 14 insertions(+), 25 deletions(-) (limited to 'java/common/src') diff --git a/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java b/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java index 4237ab9bd6..b268d03c3c 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java +++ b/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java @@ -62,10 +62,8 @@ public class FieldTable * * @param buffer the buffer from which to read data. The length byte must be read already * @param length the length of the field table. Must be > 0. - * - * @throws AMQFrameDecodingException if there is an error decoding the table */ - public FieldTable(ByteBuffer buffer, long length) throws AMQFrameDecodingException + public FieldTable(ByteBuffer buffer, long length) { this(); ByteBuffer encodedForm = buffer.slice(); 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 66ca43c145..179d371b1b 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 @@ -583,28 +583,19 @@ public class PropertyFieldTableTest extends TestCase long length = buffer.getUnsignedInt(); - try - { - FieldTable table2 = new FieldTable(buffer, length); - - Assert.assertEquals((Boolean) true, table2.getBoolean("bool")); - Assert.assertEquals((Byte) Byte.MAX_VALUE, table2.getByte("byte")); - assertBytesEqual(bytes, table2.getBytes("bytes")); - Assert.assertEquals((Character) 'c', table2.getCharacter("char")); - Assert.assertEquals(Double.MAX_VALUE, table2.getDouble("double")); - Assert.assertEquals(Float.MAX_VALUE, table2.getFloat("float")); - Assert.assertEquals((Integer) Integer.MAX_VALUE, table2.getInteger("int")); - Assert.assertEquals((Long) Long.MAX_VALUE, table2.getLong("long")); - Assert.assertEquals((Short) Short.MAX_VALUE, table2.getShort("short")); - Assert.assertEquals("hello", table2.getString("string")); - Assert.assertEquals(null, table2.getString("null-string")); - - } - catch (AMQFrameDecodingException e) - { - e.printStackTrace(); - fail("PFT should be instantiated from bytes." + e.getCause()); - } + FieldTable table2 = new FieldTable(buffer, length); + + Assert.assertEquals((Boolean) true, table2.getBoolean("bool")); + Assert.assertEquals((Byte) Byte.MAX_VALUE, table2.getByte("byte")); + assertBytesEqual(bytes, table2.getBytes("bytes")); + Assert.assertEquals((Character) 'c', table2.getCharacter("char")); + Assert.assertEquals(Double.MAX_VALUE, table2.getDouble("double")); + Assert.assertEquals(Float.MAX_VALUE, table2.getFloat("float")); + Assert.assertEquals((Integer) Integer.MAX_VALUE, table2.getInteger("int")); + Assert.assertEquals((Long) Long.MAX_VALUE, table2.getLong("long")); + Assert.assertEquals((Short) Short.MAX_VALUE, table2.getShort("short")); + Assert.assertEquals("hello", table2.getString("string")); + Assert.assertEquals(null, table2.getString("null-string")); } public void testEncodingSize() -- cgit v1.2.1