Update MRI projects for Aluminium
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / serialization / messages / FlowMessageSerializerTest.java
index c4847f21fda18c31485838d1232f29a890874029..cf9a024d8c6a1940b712bd2efb28404ab1fd4072 100644 (file)
@@ -92,12 +92,12 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
             .setInstruction(Arrays.asList(
                     new InstructionBuilder()
                             .setOrder(0)
-                            .setKey(new InstructionKey(0))
+                            .withKey(new InstructionKey(0))
                             .setInstruction(new ApplyActionsCaseBuilder()
                                     .setApplyActions(new ApplyActionsBuilder()
                                             .setAction(Collections.singletonList(new ActionBuilder()
                                                     .setOrder(0)
-                                                    .setKey(new ActionKey(0))
+                                                    .withKey(new ActionKey(0))
                                                     .setAction(new SetVlanIdActionCaseBuilder()
                                                             .setSetVlanIdAction(new SetVlanIdActionBuilder()
                                                                     .setVlanId(new VlanId(VLAN_ID))
@@ -109,12 +109,12 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
                             .build(),
                     new InstructionBuilder()
                             .setOrder(2)
-                            .setKey(new InstructionKey(2))
+                            .withKey(new InstructionKey(2))
                             .setInstruction(new ApplyActionsCaseBuilder()
                                     .setApplyActions(new ApplyActionsBuilder()
                                             .setAction(Collections.singletonList(new ActionBuilder()
-                                                    .setOrder(0)
-                                                    .setKey(new ActionKey(0))
+                                                    .setOrder(1)
+                                                    .withKey(new ActionKey(1))
                                                     .setAction(new SetTpDstActionCaseBuilder()
                                                             .setSetTpDstAction(new SetTpDstActionBuilder()
                                                                     .setIpProtocol(IP_PROTOCOL)
@@ -127,12 +127,12 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
                             .build(),
                     new InstructionBuilder()
                             .setOrder(1)
-                            .setKey(new InstructionKey(1))
+                            .withKey(new InstructionKey(1))
                             .setInstruction(new ApplyActionsCaseBuilder()
                                     .setApplyActions(new ApplyActionsBuilder()
                                             .setAction(Collections.singletonList(new ActionBuilder()
-                                                    .setOrder(0)
-                                                    .setKey(new ActionKey(0))
+                                                    .setOrder(2)
+                                                    .withKey(new ActionKey(2))
                                                     .setAction(new SetTpSrcActionCaseBuilder()
                                                             .setSetTpSrcAction(new SetTpSrcActionBuilder()
                                                                     .setIpProtocol(IP_PROTOCOL)
@@ -179,11 +179,12 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
     @Override
     protected void init() {
-        serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, FlowMessage.class));
+        serializer = getRegistry()
+                .getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, FlowMessage.class));
     }
 
     @Test
-    public void testSerialize() throws Exception {
+    public void testSerialize() {
         final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(MESSAGE, out);
 
@@ -255,7 +256,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set vlan id action
         int setVlanIdLength = 16;
-        int setVlanStartIndex = out.readerIndex();
+        final int setVlanStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setVlanIdLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
@@ -276,7 +277,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set tp src action
         int setTpSrcLength = 16;
-        int setTpSrcStartIndex = out.readerIndex();
+        final int setTpSrcStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setTpSrcLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
@@ -297,7 +298,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set tp dst action
         int setTpDstLength = 16;
-        int setTpDstStartIndex = out.readerIndex();
+        final int setTpDstStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setTpDstLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
@@ -372,7 +373,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set vlan id action
         int setVlanIdLength = 16;
-        int setVlanStartIndex = out.readerIndex();
+        final int setVlanStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setVlanIdLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
@@ -393,7 +394,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set tp src action
         int setTpSrcLength = 16;
-        int setTpSrcStartIndex = out.readerIndex();
+        final int setTpSrcStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setTpSrcLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
@@ -414,7 +415,7 @@ public class FlowMessageSerializerTest extends AbstractSerializerTest {
 
         // Set tp dst action
         int setTpDstLength = 16;
-        int setTpDstStartIndex = out.readerIndex();
+        final int setTpDstStartIndex = out.readerIndex();
         assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
         assertEquals(out.readUnsignedShort(), setTpDstLength);
         assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);