Added byte[] into ExperimenterAction
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / ActionsSerializerTest.java
index 20d5e17969d2bf5bad318e4f03aecc19db6feb5b..14f50d0be944fcf062df7d5baaca163855bb02d9 100644 (file)
@@ -167,6 +167,7 @@ public class ActionsSerializerTest {
         actionBuilder.setType(Experimenter.class);\r
         ExperimenterActionBuilder experimenter = new ExperimenterActionBuilder();\r
         experimenter.setExperimenter(4L);\r
+        experimenter.setData(new byte[]{0, 1, 2, 3, 4, 5, 6, 7});\r
         actionBuilder.addAugmentation(ExperimenterAction.class, experimenter.build());\r
         actions.add(actionBuilder.build());\r
         \r
@@ -234,8 +235,12 @@ public class ActionsSerializerTest {
         Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());\r
         out.skipBytes(4);\r
         Assert.assertEquals("Wrong action type", 65535, out.readUnsignedShort());\r
-        Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());\r
-        Assert.assertEquals("Wrong action experimenter", 4, out.readUnsignedInt());\r
+        Assert.assertEquals("Wrong action length", 16, out.readUnsignedShort());\r
+        Assert.assertEquals("Wrong experimenter", 4, out.readUnsignedInt());\r
+        byte[] data = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];\r
+        out.readBytes(data);\r
+        Assert.assertArrayEquals("Wrong data", new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, data);\r
+        Assert.assertTrue("Unread data", out.readableBytes() == 0);\r
     }\r
 \r
 }\r