Update MRI upstreams for Phosphorus
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / QueueGetConfigReplyMessageFactoryTest.java
index cac11f9551e61288431159e5235b1a49800d05d2..5f02e2c2004cbf990af6bee6e907e823cfa66ad9 100644 (file)
@@ -31,6 +31,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.QueuesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueuePropertyBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for QueueGetConfigReplyMessageFactory.
@@ -50,14 +52,14 @@ public class QueueGetConfigReplyMessageFactoryTest {
         SerializerRegistry registry = new SerializerRegistryImpl();
         registry.init();
         factory = registry
-                .getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, GetQueueConfigOutput.class));
+                .getSerializer(new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3, GetQueueConfigOutput.class));
     }
 
     @Test
     public void testSerialize() throws Exception {
         GetQueueConfigOutputBuilder builder = new GetQueueConfigOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setPort(new PortNumber(0x00010203L));
+        builder.setPort(new PortNumber(Uint32.valueOf(0x00010203)));
         builder.setQueues(createQueuesList());
         GetQueueConfigOutput message = builder.build();
 
@@ -78,7 +80,7 @@ public class QueueGetConfigReplyMessageFactoryTest {
                 serializedBuffer.readShort());
         Assert.assertEquals("Wrong property length", 16, serializedBuffer.readShort());
         serializedBuffer.skipBytes(PROPERTY_HEADER_PADDING);
-        RateQueueProperty rateQueueProperty = properties.get(0).getAugmentation(RateQueueProperty.class);
+        RateQueueProperty rateQueueProperty = properties.get(0).augmentation(RateQueueProperty.class);
         Assert.assertEquals("Wrong rate", rateQueueProperty.getRate().intValue(), serializedBuffer.readShort());
         serializedBuffer.skipBytes(PROPERTY_RATE_PADDING);
 
@@ -93,7 +95,7 @@ public class QueueGetConfigReplyMessageFactoryTest {
                 serializedBuffer.readShort());
         Assert.assertEquals("Wrong property length", 16, serializedBuffer.readShort());
         serializedBuffer.skipBytes(PROPERTY_HEADER_PADDING);
-        RateQueueProperty rateQueuePropertyTwo = propertiesTwo.get(0).getAugmentation(RateQueueProperty.class);
+        RateQueueProperty rateQueuePropertyTwo = propertiesTwo.get(0).augmentation(RateQueueProperty.class);
         Assert.assertEquals("Wrong rate", rateQueuePropertyTwo.getRate().intValue(), serializedBuffer.readShort());
         serializedBuffer.skipBytes(PROPERTY_RATE_PADDING);
 
@@ -102,23 +104,21 @@ public class QueueGetConfigReplyMessageFactoryTest {
     private static List<Queues> createQueuesList() {
         List<Queues> queuesList = new ArrayList<>();
         for (int i = 1; i < 3; i++) {
-            QueuesBuilder qb = new QueuesBuilder();
-            qb.setQueueId(new QueueId((long) i));
-            qb.setPort(new PortNumber((long) i));
-            qb.setQueueProperty(createPropertiesList());
-            queuesList.add(qb.build());
+            queuesList.add(new QueuesBuilder()
+                .setQueueId(new QueueId(Uint32.valueOf(i)))
+                .setPort(new PortNumber(Uint32.valueOf(i)))
+                .setQueueProperty(createPropertiesList())
+                .build());
         }
         return queuesList;
     }
 
     private static List<QueueProperty> createPropertiesList() {
         final List<QueueProperty> propertiesList = new ArrayList<>();
-        QueuePropertyBuilder pb = new QueuePropertyBuilder();
-        pb.setProperty(QueueProperties.forValue(2));
-        RateQueuePropertyBuilder rateBuilder = new RateQueuePropertyBuilder();
-        rateBuilder.setRate(5);
-        pb.addAugmentation(RateQueueProperty.class, rateBuilder.build());
-        propertiesList.add(pb.build());
+        propertiesList.add(new QueuePropertyBuilder()
+            .setProperty(QueueProperties.forValue(2))
+            .addAugmentation(new RateQueuePropertyBuilder().setRate(Uint16.valueOf(5)).build())
+            .build());
         return propertiesList;
     }
 }