Minor model refactor
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / OF10ActionsDeserializerTest.java
index d2db8e2f8f826bd260b44f8243c03e5f8ad859dd..62b00a8fd60d2d8259626a527af575bbf2a7eadb 100644 (file)
@@ -23,8 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
 \r
 /**\r
  * @author michal.polkorab\r
@@ -52,70 +51,70 @@ public class OF10ActionsDeserializerTest {
                 + "FF FF 00 08 00 00 12 34");\r
         \r
         message.skipBytes(4); // skip XID\r
-        List<ActionsList> actions = OF10ActionsDeserializer.createActionsList(message);\r
+        List<Action> actions = OF10ActionsDeserializer.createActionsList(message);\r
         Assert.assertEquals("Wrong number of actions", 13, actions.size());\r
-        Action action1 = actions.get(0).getAction();\r
+        Action action1 = actions.get(0);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.Output", action1.getType().getName());\r
         Assert.assertEquals("Wrong port", 16,\r
                 action1.getAugmentation(PortAction.class).getPort().getValue().intValue());\r
         Assert.assertEquals("Wrong max-length", 8192,\r
                 action1.getAugmentation(MaxLengthAction.class).getMaxLength().intValue());\r
-        Action action2 = actions.get(1).getAction();\r
+        Action action2 = actions.get(1);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetVlanVid", action2.getType().getName());\r
         Assert.assertEquals("Wrong vlan-vid", 4112,\r
                 action2.getAugmentation(VlanVidAction.class).getVlanVid().intValue());\r
-        Action action3 = actions.get(2).getAction();\r
+        Action action3 = actions.get(2);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetVlanPcp", action3.getType().getName());\r
         Assert.assertEquals("Wrong vlan-pcp", 37,\r
                 action3.getAugmentation(VlanPcpAction.class).getVlanPcp().intValue());\r
-        Action action4 = actions.get(3).getAction();\r
+        Action action4 = actions.get(3);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.StripVlan", action4.getType().getName());\r
-        Action action5 = actions.get(4).getAction();\r
+        Action action5 = actions.get(4);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetDlSrc", action5.getType().getName());\r
         Assert.assertArrayEquals("Wrong dl-src", ByteBufUtils.macAddressToBytes("01:02:03:04:05:06"), \r
                 ByteBufUtils.macAddressToBytes(action5.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));\r
-        Action action6 = actions.get(5).getAction();\r
+        Action action6 = actions.get(5);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetDlDst", action6.getType().getName());\r
         Assert.assertArrayEquals("Wrong dl-dst", ByteBufUtils.macAddressToBytes("02:03:04:05:06:07"), \r
                 ByteBufUtils.macAddressToBytes(action6.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));\r
-        Action action7 = actions.get(6).getAction();\r
+        Action action7 = actions.get(6);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetNwSrc", action7.getType().getName());\r
         Assert.assertEquals("Wrong nw-src", new Ipv4Address("10.0.0.1"),\r
                 action7.getAugmentation(IpAddressAction.class).getIpAddress());\r
-        Action action8 = actions.get(7).getAction();\r
+        Action action8 = actions.get(7);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetNwDst", action8.getType().getName());\r
         Assert.assertEquals("Wrong nw-dst", new Ipv4Address("11.0.0.2"),\r
                 action8.getAugmentation(IpAddressAction.class).getIpAddress());\r
-        Action action9 = actions.get(8).getAction();\r
+        Action action9 = actions.get(8);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetNwTos", action9.getType().getName());\r
         Assert.assertEquals("Wrong nw-tos", 1, action9.getAugmentation(NwTosAction.class).getNwTos().intValue());\r
-        Action action10 = actions.get(9).getAction();\r
+        Action action10 = actions.get(9);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetTpSrc", action10.getType().getName());\r
         Assert.assertEquals("Wrong port", 2, action10.getAugmentation(PortAction.class)\r
                 .getPort().getValue().intValue());\r
-        Action action11 = actions.get(10).getAction();\r
+        Action action11 = actions.get(10);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.SetTpDst", action11.getType().getName());\r
         Assert.assertEquals("Wrong port", 3, action11.getAugmentation(PortAction.class)\r
                 .getPort().getValue().intValue());\r
-        Action action12 = actions.get(11).getAction();\r
+        Action action12 = actions.get(11);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.Enqueue", action12.getType().getName());\r
         Assert.assertEquals("Wrong port", 4, action12.getAugmentation(PortAction.class)\r
                 .getPort().getValue().intValue());\r
         Assert.assertEquals("Wrong queue-id", 48,\r
                 action12.getAugmentation(QueueIdAction.class).getQueueId().intValue());\r
-        Action action13 = actions.get(12).getAction();\r
+        Action action13 = actions.get(12);\r
         Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
                 + ".openflow.common.action.rev130731.Experimenter", action13.getType().getName());\r
         Assert.assertEquals("Wrong port", 4660, action13.getAugmentation(ExperimenterAction.class)\r