Migrate openflow-protocol-impl tests to Uint types
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / PortModInputMessageFactoryTest.java
index a5e39f1c2f42072d7e26483e6826ec4edf154463..9b83a17f528afcdb54a855e2fe89862915cef105 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeatures;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PortModInputMessageFactory.
@@ -32,7 +33,7 @@ public class PortModInputMessageFactoryTest {
     private OFDeserializer<PortModInput> factory;
 
     @Before
-    public void startUp() throws Exception {
+    public void startUp() {
         DeserializerRegistry desRegistry = new DeserializerRegistryImpl();
         desRegistry.init();
         factory = desRegistry
@@ -40,20 +41,18 @@ public class PortModInputMessageFactoryTest {
     }
 
     @Test
-    public void test() throws Exception {
+    public void test() {
         ByteBuf bb = BufferHelper.buildBuffer(
                 "00 00 00 09 00 00 00 00 08 00 27 00 " + "b0 eb 00 00 00 00 00 24 00 00 00 41 00 00 01 10 00 00 00 00");
         PortModInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV13(deserializedMessage);
 
         // Test Message
-        Assert.assertEquals("Wrong port", new PortNumber(9L), deserializedMessage.getPortNo());
+        Assert.assertEquals("Wrong port", new PortNumber(Uint32.valueOf(9)), deserializedMessage.getPortNo());
         Assert.assertEquals("Wrong hwAddr", new MacAddress("08:00:27:00:b0:eb"), deserializedMessage.getHwAddress());
         Assert.assertEquals("Wrong config", new PortConfig(true, false, true, false), deserializedMessage.getConfig());
         Assert.assertEquals("Wrong mask", new PortConfig(false, true, false, true), deserializedMessage.getMask());
         Assert.assertEquals("Wrong advertise", new PortFeatures(true, false, false, false, false, false, false, true,
                 false, false, false, false, false, false, false, false), deserializedMessage.getAdvertise());
-
     }
-
 }