Added byte[] into ExperimenterAction
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / ActionsDeserializerTest.java
index d7f79c8cb5be72e647e32cd1da1f66f4fb3dd6ff..a63edea95735bf90c54ff2624fd5b25cf1e71df5 100644 (file)
@@ -14,6 +14,7 @@ import java.util.List;
 import org.junit.Assert;\r
 import org.junit.Test;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterAction;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;\r
@@ -55,7 +56,8 @@ public class ActionsDeserializerTest {
                 + "00 18 00 08 00 00 00 00 "\r
                 + "00 19 00 10 80 00 02 04 00 00 00 0B 00 00 00 00 "\r
                 + "00 1A 00 08 00 0A 00 00 "\r
-                + "00 1B 00 08 00 00 00 00");\r
+                + "00 1B 00 08 00 00 00 00 "\r
+                + "FF FF 00 10 00 00 00 08 00 01 02 03 04 05 06 07");\r
         \r
         message.skipBytes(4); // skip XID\r
         LOGGER.info("bytes: " + message.readableBytes());\r
@@ -121,6 +123,12 @@ public class ActionsDeserializerTest {
                 actions.get(14).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
                 + "openflow.common.action.rev130731.PopPbb", actions.get(15).getType().getName());\r
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
+                + "openflow.common.action.rev130731.Experimenter", actions.get(16).getType().getName());\r
+        Assert.assertEquals("Wrong experimenter", 8, actions.get(16).getAugmentation(ExperimenterAction.class)\r
+                .getExperimenter().intValue());\r
+        Assert.assertArrayEquals("Wrong data", new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, actions.get(16)\r
+                .getAugmentation(ExperimenterAction.class).getData());\r
         Assert.assertTrue("Unread data in message", message.readableBytes() == 0);\r
     }\r
 \r