Use ByteBuf.readRetainedSlice()
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / OF10PacketInMessageFactoryTest.java
index ab40cd0704ff54755720db00e1ff607b21379ff7..166a104dea4524812e9e695094502e8d86b70c38 100644 (file)
@@ -22,6 +22,8 @@ import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10PacketInMessageFactory.
@@ -36,16 +38,16 @@ public class OF10PacketInMessageFactoryTest {
     public void startUp() {
         SerializerRegistry registry = new SerializerRegistryImpl();
         registry.init();
-        factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, PacketInMessage.class));
+        factory = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_0, PacketInMessage.class));
     }
 
     @Test
     public void testSerialize() throws Exception {
         PacketInMessageBuilder builder = new PacketInMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setBufferId(1L);
-        builder.setTotalLen(1);
-        builder.setInPort(1);
+        builder.setBufferId(Uint32.ONE);
+        builder.setTotalLen(Uint16.ONE);
+        builder.setInPort(Uint16.ONE);
         builder.setReason(PacketInReason.forValue(0));
         byte[] data = ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14");
         builder.setData(data);