Update MRI upstreams for Phosphorus
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / test / java / org / opendaylight / openflowjava / nx / codec / action / DecapCodecTest.java
index 78fca58b55916989899e8bb7f76225ce7ea7f8f5..e72da8ec7faa21fde09767e18f216b921bfb220b 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowjava.nx.codec.action;
 
 import static org.junit.Assert.assertEquals;
@@ -20,15 +19,16 @@ import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionDecapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.aug.nx.action.ActionDecap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.aug.nx.action.ActionDecapBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.decap.grouping.NxActionDecapBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class DecapCodecTest {
 
     private static final int LENGTH = 16;
     private static final int SUBTYPE = 47;
-    private static final long PACKET_TYPE = 0xFFFEL;
+    private static final Uint32 PACKET_TYPE = Uint32.valueOf(0xFFFEL);
 
     DecapCodec decapCodec;
     ByteBuf buffer;
@@ -48,7 +48,7 @@ public class DecapCodecTest {
 
         ActionDecap result = (ActionDecap) action.getActionChoice();
 
-        assertEquals(PACKET_TYPE, result.getNxActionDecap().getPacketType().longValue());
+        assertEquals(PACKET_TYPE, result.getNxActionDecap().getPacketType());
         assertFalse(buffer.isReadable());
     }
 
@@ -65,20 +65,20 @@ public class DecapCodecTest {
         assertEquals(SUBTYPE, buffer.readUnsignedShort());
         //Serialize part
         assertEquals(0, buffer.readUnsignedShort());
-        assertEquals(PACKET_TYPE, buffer.readUnsignedInt());
+        assertEquals(PACKET_TYPE.longValue(), buffer.readUnsignedInt());
         assertFalse(buffer.isReadable());
     }
 
-    private void createBuffer(ByteBuf message) {
+    private static void createBuffer(final ByteBuf message) {
         message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
         message.writeShort(LENGTH);
         message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
         message.writeShort(SUBTYPE);
         message.writeZero(2);
-        message.writeInt((int) PACKET_TYPE);
+        message.writeInt(PACKET_TYPE.intValue());
     }
 
-    private Action createAction() {
+    private static Action createAction() {
         ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setExperimenterId(experimenterId);