You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2013/02/25 23:29:24 UTC

svn commit: r1449942 - /qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java

Author: aconway
Date: Mon Feb 25 22:29:22 2013
New Revision: 1449942

URL: http://svn.apache.org/r1449942
Log:
PROTON-215: Add tests for described types and arrays to InteropTest.java.

Modified:
    qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java

Modified: qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java?rev=1449942&r1=1449941&r2=1449942&view=diff
==============================================================================
--- qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java (original)
+++ qpid/proton/trunk/tests/java/org/apache/qpid/proton/InteropTest.java Mon Feb 25 22:29:22 2013
@@ -21,6 +21,7 @@ package org.apache.qpid.proton;
 import org.apache.qpid.proton.TestDecoder;
 import org.apache.qpid.proton.ProtonFactoryLoader;
 import org.apache.qpid.proton.amqp.Binary;
+import org.apache.qpid.proton.amqp.DescribedType;
 import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.UnsignedByte;
 import org.apache.qpid.proton.amqp.UnsignedInteger;
@@ -33,6 +34,7 @@ import org.apache.qpid.proton.message.Me
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertArrayEquals;
 import org.junit.Test;
+import org.junit.Ignore;
 import java.lang.System;
 import java.io.File;
 import java.io.FileInputStream;
@@ -118,12 +120,27 @@ public class InteropTest {
 
     @Test
     public void testDescribed() throws IOException {
-	// FIXME aconway 2013-02-18: TODO
+	TestDecoder d = createDecoder(getBytes("described"));
+	DescribedType dt = (DescribedType)(d.readObject());
+	assertEquals(Symbol.valueOf("foo-descriptor"), dt.getDescriptor());
+	assertEquals("foo-value", dt.getDescribed());
+
+	dt = (DescribedType)(d.readObject());
+	assertEquals(12, dt.getDescriptor());
+	assertEquals(13, dt.getDescribed());
     }
 
-    @Test
-    public void testDescribedArray() throws IOException {
-	// FIXME aconway 2013-02-18: TODO
+
+    // FIXME aconway 2013-02-19:
+    @Ignore("PROTON-240: Incorrect encoding of described arrays.")
+    @Test
+    public void skip_testDescribedArray() throws IOException {
+        TestDecoder d = createDecoder(getBytes("described_array"));
+	DescribedType a[] = (DescribedType[])(d.readArray());
+	for (int i = 0; i < 10; ++i) {
+	    assertEquals("int-array", a[i].getDescriptor());
+	    assertEquals(i, a[i].getDescribed());
+	}
     }
 
     @Test



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org