Migrate openflow-protocol-impl tests to Uint types 71/92671/5
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Sep 2020 11:40:19 +0000 (13:40 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Sep 2020 15:44:55 +0000 (17:44 +0200)
There are plenty of warnings in the test suite, address all of them
without touching production code.

JIRA: OPNFLWPLUG-1099
Change-Id: I8ec19c008ef51dfdabeded610bef4bda4e11d8f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
90 files changed:
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoderTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImplTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueEntryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GetQueueConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/GroupModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MeterModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestAggregateInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestFlowInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestGroupInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestMeterConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestMeterInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestPortStatsInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestQueueInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/MultipartRequestTableFeaturesInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10GetQueueConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsRequestInputAggregateFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsRequestInputFlowFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsRequestInputPortStatsFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10StatsRequestInputQueueFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/TableModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/SerializationFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ErrorMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/ExperimenterInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetConfigReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetFeaturesOutputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GetQueueConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/GroupModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MultipartRequestInputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FeaturesReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10FlowRemovedMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10PortStatusMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10QueueGetConfigInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketInMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PacketOutInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/PortStatusMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/QueueGetConfigReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleReplyMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/RoleRequestInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/SetConfigMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/TableModInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/VendorInputMessageFactoryTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestExperimenterTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/MultipartRequestTableFeaturesTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestAggregateTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/multipart/OF10StatsRequestExperimenterTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmArpOpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmEthTypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4CodeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv4TypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6CodeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIcmpv6TypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpDscpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmIpProtoSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsLabelSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmMplsTcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPacketTypeSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmPbbIsidSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmSctpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmTcpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpDstSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmUdpSrcSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanPcpSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/serialization/match/OxmVlanVidSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10ActionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13ActionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13InstructionsSerializerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer02Test.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializerTest.java

index 7a477103c1ecb1820ae31743b111e1c804401615..3788b046585c68ca391595e92842fbae70f8b46f 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.protocol.impl.core;
 
 import static org.mockito.Mockito.times;
@@ -26,6 +25,7 @@ import org.opendaylight.openflowjava.protocol.impl.core.connection.UdpMessageLis
 import org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OFDatagramPacketEncoder.
@@ -47,7 +47,7 @@ public class OFDatagramPacketEncoderTest {
      *
      * @param version openflow protocol wire version
      */
-    public void startUp(Short version) {
+    public void startUp(Uint8 version) {
         MockitoAnnotations.initMocks(this);
         out = new ArrayList<>();
         HelloInputBuilder builder = new HelloInputBuilder();
@@ -61,7 +61,7 @@ public class OFDatagramPacketEncoderTest {
      */
     @Test
     public void testCorrectEncode() throws Exception {
-        startUp((short) EncodeConstants.OF13_VERSION_ID);
+        startUp(EncodeConstants.OF_VERSION_1_3);
         OFDatagramPacketEncoder encoder = new OFDatagramPacketEncoder();
         encoder.setSerializationFactory(factory);
         encoder.encode(ctx, wrapper, out);
index 53f42a6e02108d5886fd250f0f720782b2384882..ace4389d97778e1c83894b6f9c9fb7b6d5f40acc 100644 (file)
@@ -56,6 +56,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.S
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SwitchIdleEventBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
 import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit test for ConnectionAdapterImpl.
@@ -146,7 +147,7 @@ public class ConnectionAdapterImplTest {
     public void testConsume2() {
         adapter.setResponseCache(mockCache);
         final BarrierOutputBuilder barrierBuilder = new BarrierOutputBuilder();
-        barrierBuilder.setXid(42L);
+        barrierBuilder.setXid(Uint32.valueOf(42));
         final BarrierOutput barrier = barrierBuilder.build();
         adapter.consume(barrier);
         verify(mockCache, times(1)).getIfPresent(any(RpcResponseKey.class));
@@ -158,8 +159,8 @@ public class ConnectionAdapterImplTest {
     @Test
     public void testConsume3() {
         final BarrierInputBuilder inputBuilder = new BarrierInputBuilder();
-        inputBuilder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
-        inputBuilder.setXid(42L);
+        inputBuilder.setVersion(EncodeConstants.OF_VERSION_1_3);
+        inputBuilder.setXid(Uint32.valueOf(42));
         final BarrierInput barrierInput = inputBuilder.build();
         final RpcResponseKey key = new RpcResponseKey(42L,
                 "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput");
@@ -167,7 +168,7 @@ public class ConnectionAdapterImplTest {
                 "failure", mockCache, key);
         cache.put(key, listener);
         final BarrierOutputBuilder barrierBuilder = new BarrierOutputBuilder();
-        barrierBuilder.setXid(42L);
+        barrierBuilder.setXid(Uint32.valueOf(42));
         final BarrierOutput barrierOutput = barrierBuilder.build();
         adapter.consume(barrierOutput);
         final ResponseExpectedRpcListener<?> ifPresent = cache.getIfPresent(key);
index f8a09e23c7d8590b0aa190758825d9a81674fa75..db497aa58de17e68fa9bb55d80eefbfab7f123cb 100644 (file)
@@ -23,6 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,8 +36,8 @@ public class OutboundQueueEntryTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(OutboundQueueEntryTest.class);
 
-    private static final short VERSION = (short) 13;
-    private static final long VALUE = 1L;
+    private static final Uint8 VERSION = Uint8.valueOf(13);
+    private static final Uint32 VALUE = Uint32.ONE;
 
     private Integer failCounter = 0;
 
@@ -109,7 +111,7 @@ public class OutboundQueueEntryTest {
     @Test
     public void test() {
 
-        final FutureCallback<OfHeader> result = new FutureCallback<OfHeader>() {
+        final FutureCallback<OfHeader> result = new FutureCallback<>() {
             @Override
             public void onSuccess(@Nullable OfHeader header) {
                 LOG.info("onSuccess: xid: {}", header.getXid());
index 6e554781309793d90cfc45c77338aa97d18228ec..953f7f468f91a7cccc24de4675db97169801724d 100644 (file)
@@ -48,7 +48,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for FlowModInputMessageFactory.
@@ -81,13 +84,13 @@ public class FlowModInputMessageFactoryTest {
         Assert.assertEquals("Wrong cookie", Uint64.valueOf("FF01040106000701", 16), deserializedMessage.getCookie());
         Assert.assertEquals("Wrong cookie mask", Uint64.valueOf("FF05000009300030", 16),
             deserializedMessage.getCookieMask());
-        Assert.assertEquals("Wrong table id", new TableId(65L), deserializedMessage.getTableId());
+        Assert.assertEquals("Wrong table id", new TableId(Uint32.valueOf(65)), deserializedMessage.getTableId());
         Assert.assertEquals("Wrong command", FlowModCommand.forValue(2), deserializedMessage.getCommand());
         Assert.assertEquals("Wrong idle timeout", 12, deserializedMessage.getIdleTimeout().intValue());
         Assert.assertEquals("Wrong hard timeout", 0, deserializedMessage.getHardTimeout().intValue());
         Assert.assertEquals("Wrong priority", 126, deserializedMessage.getPriority().intValue());
         Assert.assertEquals("Wrong buffer id ", 2L, deserializedMessage.getBufferId().longValue());
-        Assert.assertEquals("Wrong out port", new PortNumber(4422L), deserializedMessage.getOutPort());
+        Assert.assertEquals("Wrong out port", new PortNumber(Uint32.valueOf(4422)), deserializedMessage.getOutPort());
         Assert.assertEquals("Wrong out group", 98L, deserializedMessage.getOutGroup().longValue());
         Assert.assertEquals("Wrong flags", new FlowModFlags(true, false, true, false, true),
                 deserializedMessage.getFlags());
@@ -101,7 +104,7 @@ public class FlowModInputMessageFactoryTest {
         InstructionBuilder insBuilder = new InstructionBuilder();
         GotoTableCaseBuilder goToCaseBuilder = new GotoTableCaseBuilder();
         GotoTableBuilder instructionBuilder = new GotoTableBuilder();
-        instructionBuilder.setTableId((short) 43);
+        instructionBuilder.setTableId(Uint8.valueOf(43));
         goToCaseBuilder.setGotoTable(instructionBuilder.build());
         insBuilder.setInstructionChoice(goToCaseBuilder.build());
         instructions.add(insBuilder.build());
@@ -121,8 +124,8 @@ public class FlowModInputMessageFactoryTest {
         final ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(52);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(52));
         caseBuilder.setOutputAction(outputBuilder.build());
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
@@ -143,7 +146,7 @@ public class FlowModInputMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -152,7 +155,7 @@ public class FlowModInputMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 4);
+        ipEcnBuilder.setEcn(Uint8.valueOf(4));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entriesBuilder.build());
index a38e074c1ee8b8bf2027cdfedf420cd45eab1d1f..9a4e48e522773376003a84e2f4c909b77d568290 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.protocol.impl.deserialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -20,6 +19,7 @@ import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerR
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for FlowRemovedMessageFactory.
@@ -56,7 +56,7 @@ public class FlowRemovedMessageFactoryTest {
         Assert.assertTrue(builtByFactory.getCookie().longValue() == 0x0001020304050607L);
         Assert.assertTrue(builtByFactory.getPriority().toJava() == 0x03);
         Assert.assertEquals("Wrong reason", 0x02, builtByFactory.getReason().getIntValue());
-        Assert.assertEquals("Wrong tableId", new TableId(4L), builtByFactory.getTableId());
+        Assert.assertEquals("Wrong tableId", new TableId(Uint32.valueOf(4)), builtByFactory.getTableId());
         Assert.assertEquals("Wrong durationSec", 0x02L, builtByFactory.getDurationSec().longValue());
         Assert.assertEquals("Wrong durationNsec", 0x05L, builtByFactory.getDurationNsec().longValue());
         Assert.assertEquals("Wrong idleTimeout", 0x01, builtByFactory.getIdleTimeout().intValue());
@@ -64,5 +64,4 @@ public class FlowRemovedMessageFactoryTest {
         Assert.assertEquals("Wrong packetCount", 0x0001020304050607L, builtByFactory.getPacketCount().longValue());
         Assert.assertEquals("Wrong byteCount", 0x0001020304050607L, builtByFactory.getByteCount().longValue());
     }
-
 }
index a62733da31d962b8e67e65f3f9de178f51e7c754..2f10e9f043bc7b5bf69be43140ac585885151426 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerR
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * UNit tests for GetQueueConfigInputMessageFactory.
@@ -41,7 +42,8 @@ public class GetQueueConfigInputMessageFactoryTest {
         ByteBuf bb = BufferHelper.buildBuffer("00 01 02 03 00 00 00 00");
         GetQueueConfigInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV13(deserializedMessage);
-        Assert.assertEquals("Wrong  Port No", new PortNumber(0x00010203L), deserializedMessage.getPort());
+        Assert.assertEquals("Wrong  Port No", new PortNumber(Uint32.valueOf(0x00010203)),
+            deserializedMessage.getPort());
     }
 
 }
index 88efab43987ac64d796e47a2e398028ecfb30ae5..6cc14a9e454aadf3beeae9e5475c83d641bf2197 100644 (file)
@@ -23,6 +23,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.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for GroupModInputMessageFactory.
@@ -50,10 +51,10 @@ public class GroupModInputMessageFactoryTest {
         // Test Message
         Assert.assertEquals("Wrong command", GroupModCommand.forValue(2), deserializedMessage.getCommand());
         Assert.assertEquals("Wrong type", GroupType.forValue(3), deserializedMessage.getType());
-        Assert.assertEquals("Wrong group id", new GroupId(256L), deserializedMessage.getGroupId());
+        Assert.assertEquals("Wrong group id", new GroupId(Uint32.valueOf(256)), deserializedMessage.getGroupId());
         BucketsList bucket = deserializedMessage.getBucketsList().get(0);
         Assert.assertEquals("Wrong weight", 10, bucket.getWeight().intValue());
-        Assert.assertEquals("Wrong watch port", new PortNumber(65L), bucket.getWatchPort());
+        Assert.assertEquals("Wrong watch port", new PortNumber(Uint32.valueOf(65)), bucket.getWatchPort());
         Assert.assertEquals("Wrong watch group", 22L, bucket.getWatchGroup().longValue());
     }
 
index 1ce17d29f936e1f7e5393e47748f47e719f37ac5..a78b5c8c01549c9144546703c11bfa24915be36b 100644 (file)
@@ -30,6 +30,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.meter.band.dscp.remark._case.MeterBandDscpRemarkBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.Bands;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.BandsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MeterModInputMessageFactory.
@@ -58,7 +60,7 @@ public class MeterModInputMessageFactoryTest {
 
         Assert.assertEquals("Wrong command", MeterModCommand.forValue(1), deserializedMessage.getCommand());
         Assert.assertEquals("Wrong flags", new MeterFlags(false, true, true, false), deserializedMessage.getFlags());
-        Assert.assertEquals("Wrong meter id", new MeterId(2248L), deserializedMessage.getMeterId());
+        Assert.assertEquals("Wrong meter id", new MeterId(Uint32.valueOf(2248)), deserializedMessage.getMeterId());
         Assert.assertEquals("Wrong band", createBandsList().get(0), deserializedMessage.getBands().get(0));
         Assert.assertEquals("Wrong band", createBandsList().get(1), deserializedMessage.getBands().get(1));
     }
@@ -69,16 +71,16 @@ public class MeterModInputMessageFactoryTest {
         final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.OFPMBTDROP);
-        dropBand.setRate(1L);
-        dropBand.setBurstSize(2L);
+        dropBand.setRate(Uint32.ONE);
+        dropBand.setBurstSize(Uint32.TWO);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
         final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.OFPMBTDSCPREMARK);
-        dscpRemarkBand.setRate(1L);
-        dscpRemarkBand.setBurstSize(2L);
-        dscpRemarkBand.setPrecLevel((short) 3);
+        dscpRemarkBand.setRate(Uint32.ONE);
+        dscpRemarkBand.setBurstSize(Uint32.TWO);
+        dscpRemarkBand.setPrecLevel(Uint8.valueOf(3));
         dscpCaseBuilder.setMeterBandDscpRemark(dscpRemarkBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build());
         return bandsList;
index 726f0c303df4f4aadb62465be066cd81fef70325..d48f5bfba326324db136e0551c98e0e3b8fa9cf7 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
 
 import io.netty.buffer.ByteBuf;
-import java.math.BigInteger;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,6 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MultipartRequestAggregateInputMessageFactory.
@@ -58,13 +60,11 @@ public class MultipartRequestAggregateInputMessageFactoryTest {
     private static MultipartRequestAggregateCase createRequestAggregate() {
         final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
         MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
-        builder.setTableId((short) 8);
-        builder.setOutPort(85L);
-        builder.setOutGroup(95L);
-        byte[] cookie = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setTableId(Uint8.valueOf(8));
+        builder.setOutPort(Uint32.valueOf(85));
+        builder.setOutGroup(Uint32.valueOf(95));
+        builder.setCookie(Uint64.valueOf("0001010101010101", 16));
+        builder.setCookieMask(Uint64.valueOf("0001010101010101", 16));
         caseBuilder.setMultipartRequestAggregate(builder.build());
         return caseBuilder.build();
     }
index 48fbc4cae65b09ce02929d4961e582b5456d018e..e5062255267b0948f210620c23c721dae174049f 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
 
 import io.netty.buffer.ByteBuf;
-import java.math.BigInteger;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -24,6 +23,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MultipartRequestFlowInputMessageFactory.
@@ -58,13 +60,11 @@ public class MultipartRequestFlowInputMessageFactoryTest {
     private static MultipartRequestFlowCase createRequestFlow() {
         final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
         MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
-        builder.setTableId((short) 8);
-        builder.setOutPort(85L);
-        builder.setOutGroup(95L);
-        byte[] cookie = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[] { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setTableId(Uint8.valueOf(8));
+        builder.setOutPort(Uint32.valueOf(85));
+        builder.setOutGroup(Uint32.valueOf(95));
+        builder.setCookie(Uint64.valueOf("0001010101010101", 16));
+        builder.setCookieMask(Uint64.valueOf("0001010101010101", 16));
         caseBuilder.setMultipartRequestFlow(builder.build());
         return caseBuilder.build();
     }
index 4967b44633bdb564c9c446836a222d7f6c98f6aa..4133e6bfbe1936b9b31fcf11114dbf71ea1be887 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroupBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestGroupInputMessageFactory.
@@ -56,7 +57,7 @@ public class MultipartRequestGroupInputMessageFactoryTest {
     private static MultipartRequestGroupCase createRequestGroup() {
         MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
         MultipartRequestGroupBuilder builder = new MultipartRequestGroupBuilder();
-        builder.setGroupId(new GroupId(2258L));
+        builder.setGroupId(new GroupId(Uint32.valueOf(2258)));
         caseBuilder.setMultipartRequestGroup(builder.build());
         return caseBuilder.build();
     }
index f6016186992ffee1375cd68c49c3276c0d4fc424..0a5e2bc59891ba4652d850efec126813c4bd17bd 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterConfigCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter.config._case.MultipartRequestMeterConfigBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestMeterConfigInputMessageFactory.
@@ -56,7 +57,7 @@ public class MultipartRequestMeterConfigInputMessageFactoryTest {
     private static MultipartRequestMeterConfigCase createRequestMeterConfig() {
         MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
         MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
-        builder.setMeterId(new MeterId(1133L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(1133)));
         caseBuilder.setMultipartRequestMeterConfig(builder.build());
         return caseBuilder.build();
     }
index 9317c41f0533893a18007b1ae74276537362f7f4..ce84200119964d61707ccf09e0c4b46b35362d8c 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter._case.MultipartRequestMeterBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestMeterInputMessageFactory.
@@ -54,7 +55,7 @@ public class MultipartRequestMeterInputMessageFactoryTest {
     private static MultipartRequestMeterCase createRequestMeter() {
         MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
         MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
-        builder.setMeterId(new MeterId(1121L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(1121)));
         caseBuilder.setMultipartRequestMeter(builder.build());
         return caseBuilder.build();
     }
index 8d1df68eea682964ddc1336343e4a1bb37dcabf1..a5d3ba2cda36fc57a16d4b3a8e3ae1b0711e82b8 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestPortStatsInputMessageFactory.
@@ -54,7 +55,7 @@ public class MultipartRequestPortStatsInputMessageFactoryTest {
     private static MultipartRequestPortStatsCase createRequestPortStats() {
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder builder = new MultipartRequestPortStatsBuilder();
-        builder.setPortNo(2251L);
+        builder.setPortNo(Uint32.valueOf(2251));
         caseBuilder.setMultipartRequestPortStats(builder.build());
         return caseBuilder.build();
     }
index 65ff4f7662f698e755e15a0e4b92b54f7ad421a3..01c00534c7bfb20b0259674fe4059ebc69294a21 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestQueueInputMessageFactory.
@@ -54,8 +55,8 @@ public class MultipartRequestQueueInputMessageFactoryTest {
     private static MultipartRequestQueueCase createRequestQueue() {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder builder = new MultipartRequestQueueBuilder();
-        builder.setPortNo(2256L);
-        builder.setQueueId(2211L);
+        builder.setPortNo(Uint32.valueOf(2256));
+        builder.setQueueId(Uint32.valueOf(2211));
         caseBuilder.setMultipartRequestQueue(builder.build());
         return caseBuilder.build();
     }
index e2ae95ee93bcc20f6217867e28ffae6d438e1826..d6e1d1641bff211c91f48631921c8b6ac77b9ad4 100644 (file)
@@ -156,7 +156,7 @@ public class MultipartRequestTableFeaturesInputMessageFactoryTest {
     public List<NextTableIds> createNextTableIds() {
         List<NextTableIds> list = new ArrayList<>();
         NextTableIdsBuilder builder = new NextTableIdsBuilder();
-        builder.setTableId((short) 1);
+        builder.setTableId(Uint8.ONE);
         list.add(builder.build());
         return list;
     }
index 9312437a90400c7b272852b2e62fb49099781193..a8ca14a244bc98b8542fafa9ade34d3531df812d 100644 (file)
@@ -34,7 +34,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10FlowModInputMessageFactory.
@@ -67,7 +70,7 @@ public class OF10FlowModInputMessageFactoryTest {
         Assert.assertEquals("Wrong Hard Timeout", 16, deserializedMessage.getHardTimeout().intValue());
         Assert.assertEquals("Wrong priority", 1, deserializedMessage.getPriority().intValue());
         Assert.assertEquals("Wrong buffer id", 2L, deserializedMessage.getBufferId().longValue());
-        Assert.assertEquals("Wrong out port", new PortNumber(4422L), deserializedMessage.getOutPort());
+        Assert.assertEquals("Wrong out port", new PortNumber(Uint32.valueOf(4422)), deserializedMessage.getOutPort());
         Assert.assertEquals("Wrong flags", new FlowModFlagsV10(true, false, true), deserializedMessage.getFlagsV10());
         Assert.assertEquals("Wrong actions", createAction(), deserializedMessage.getAction());
     }
@@ -84,7 +87,7 @@ public class OF10FlowModInputMessageFactoryTest {
         actionBuilder = new ActionBuilder();
         SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
         SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
-        tpSrcBuilder.setPort(new PortNumber(42L));
+        tpSrcBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
         tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
         actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -94,20 +97,20 @@ public class OF10FlowModInputMessageFactoryTest {
     private static MatchV10 createMatch() {
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 0);
-        matchBuilder.setNwDstMask((short) 0);
-        matchBuilder.setInPort(58);
+        matchBuilder.setNwSrcMask(Uint8.ZERO);
+        matchBuilder.setNwDstMask(Uint8.ZERO);
+        matchBuilder.setInPort(Uint16.valueOf(58));
         matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
-        matchBuilder.setDlVlan(18);
-        matchBuilder.setDlVlanPcp((short) 5);
-        matchBuilder.setDlType(42);
-        matchBuilder.setNwTos((short) 4);
-        matchBuilder.setNwProto((short) 7);
+        matchBuilder.setDlVlan(Uint16.valueOf(18));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(5));
+        matchBuilder.setDlType(Uint16.valueOf(42));
+        matchBuilder.setNwTos(Uint8.valueOf(4));
+        matchBuilder.setNwProto(Uint8.valueOf(7));
         matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
         matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
-        matchBuilder.setTpSrc(6653);
-        matchBuilder.setTpDst(6633);
+        matchBuilder.setTpSrc(Uint16.valueOf(6653));
+        matchBuilder.setTpDst(Uint16.valueOf(6633));
         return matchBuilder.build();
     }
 }
index 275ec289f83f58a1e756700614d525c1ee45e5ff..fdab663b2dd3e2dd1c1e37905ddadac4e0858801 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerR
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10GetQueueConfigInputMessageFactory.
@@ -41,6 +42,6 @@ public class OF10GetQueueConfigInputMessageFactoryTest {
         ByteBuf bb = BufferHelper.buildBuffer("19 fd 00 00");
         GetQueueConfigInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV10(deserializedMessage);
-        Assert.assertEquals("Wrong port", new PortNumber(6653L), deserializedMessage.getPort());
+        Assert.assertEquals("Wrong port", new PortNumber(Uint32.valueOf(6653)), deserializedMessage.getPort());
     }
 }
index a3231f3ea923e9dd943e61288e47bc22f9dfd670..0236d23f08d32e768eae585026bfa3a480f20be2 100644 (file)
@@ -27,6 +27,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 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.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10PacketOutInputMessageFactory.
@@ -52,7 +54,7 @@ public class OF10PacketOutInputMessageFactoryTest {
         PacketOutInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV10(deserializedMessage);
         Assert.assertEquals("Wrong bufferId ", 256L, deserializedMessage.getBufferId().longValue());
-        Assert.assertEquals("Wrong inPort ", new PortNumber(257L), deserializedMessage.getInPort());
+        Assert.assertEquals("Wrong inPort ", new PortNumber(Uint32.valueOf(257)), deserializedMessage.getInPort());
         Assert.assertEquals("Wrong action ", createActionList().get(0), deserializedMessage.getAction().get(0));
         Assert.assertEquals("Wrong action ", createActionList().get(1), deserializedMessage.getAction().get(1));
         Assert.assertArrayEquals("Wrong data ",
@@ -64,8 +66,8 @@ public class OF10PacketOutInputMessageFactoryTest {
         final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(50);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(50));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
index 4e17b5597b79bb7d925898b6829d0a36a09ab3fe..ab1b2c513aea3231a8f3ed745d2f29754d50eb23 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.PortFeaturesV10;
 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 OF10PortModInputMessageFactory.
@@ -45,7 +46,7 @@ public class OF10PortModInputMessageFactoryTest {
                 .buildBuffer("19 e9 08 00 27 00 b0 eb " + "00 00 00 15 00 00 00 62 00 00 02 8c 00 00 00 00 ");
         PortModInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV10(deserializedMessage);
-        Assert.assertEquals("Wrong port", new PortNumber(6633L), deserializedMessage.getPortNo());
+        Assert.assertEquals("Wrong port", new PortNumber(Uint32.valueOf(6633)), deserializedMessage.getPortNo());
         Assert.assertEquals("Wrong hwAddr", new MacAddress("08:00:27:00:b0:eb"), deserializedMessage.getHwAddress());
         Assert.assertEquals("Wrong config", new PortConfigV10(true, false, false, true, false, false, true),
                 deserializedMessage.getConfigV10());
index 1bf2e776c4c8146604ea88c2d7a80f54000ed9a0..72e1f2c8adebd1050b4b416d240cceb70f91eeb5 100644 (file)
@@ -26,6 +26,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10StatsRequestInputAggregateFactory.
@@ -62,23 +65,23 @@ public class OF10StatsRequestInputAggregateFactoryTest {
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(
                 new FlowWildcardsV10(false, false, false, false, false, false, false, false, false, false));
-        matchBuilder.setNwSrcMask((short) 32);
-        matchBuilder.setNwDstMask((short) 32);
-        matchBuilder.setInPort(51);
+        matchBuilder.setNwSrcMask(Uint8.valueOf(32));
+        matchBuilder.setNwDstMask(Uint8.valueOf(32));
+        matchBuilder.setInPort(Uint16.valueOf(51));
         matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
         matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
-        matchBuilder.setDlVlan(52);
-        matchBuilder.setDlVlanPcp((short) 53);
-        matchBuilder.setDlType(54);
-        matchBuilder.setNwTos((short) 55);
-        matchBuilder.setNwProto((short) 56);
+        matchBuilder.setDlVlan(Uint16.valueOf(52));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(53));
+        matchBuilder.setDlType(Uint16.valueOf(54));
+        matchBuilder.setNwTos(Uint8.valueOf(55));
+        matchBuilder.setNwProto(Uint8.valueOf(56));
         matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
         matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
-        matchBuilder.setTpSrc(57);
-        matchBuilder.setTpDst(58);
+        matchBuilder.setTpSrc(Uint16.valueOf(57));
+        matchBuilder.setTpDst(Uint16.valueOf(58));
         aggregateBuilder.setMatchV10(matchBuilder.build());
-        aggregateBuilder.setTableId((short) 42);
-        aggregateBuilder.setOutPort(6653L);
+        aggregateBuilder.setTableId(Uint8.valueOf(42));
+        aggregateBuilder.setOutPort(Uint32.valueOf(6653));
         caseBuilder.setMultipartRequestAggregate(aggregateBuilder.build());
         return caseBuilder.build();
     }
index 72abb5e4b9d3a31bce859461c0be939099a04772..1e473cfe1a94aa58474565d2cd267200edb7df18 100644 (file)
@@ -26,6 +26,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10StatsRequestInputFlowFactory.
@@ -61,23 +64,23 @@ public class OF10StatsRequestInputFlowFactoryTest {
         final MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 8);
-        matchBuilder.setNwDstMask((short) 16);
-        matchBuilder.setInPort(51);
+        matchBuilder.setNwSrcMask(Uint8.valueOf(8));
+        matchBuilder.setNwDstMask(Uint8.valueOf(16));
+        matchBuilder.setInPort(Uint16.valueOf(51));
         matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
         matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
-        matchBuilder.setDlVlan(52);
-        matchBuilder.setDlVlanPcp((short) 53);
-        matchBuilder.setDlType(54);
-        matchBuilder.setNwTos((short) 55);
-        matchBuilder.setNwProto((short) 56);
+        matchBuilder.setDlVlan(Uint16.valueOf(52));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(53));
+        matchBuilder.setDlType(Uint16.valueOf(54));
+        matchBuilder.setNwTos(Uint8.valueOf(55));
+        matchBuilder.setNwProto(Uint8.valueOf(56));
         matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
         matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
-        matchBuilder.setTpSrc(57);
-        matchBuilder.setTpDst(58);
+        matchBuilder.setTpSrc(Uint16.valueOf(57));
+        matchBuilder.setTpDst(Uint16.valueOf(58));
         flowBuilder.setMatchV10(matchBuilder.build());
-        flowBuilder.setTableId((short) 1);
-        flowBuilder.setOutPort(42L);
+        flowBuilder.setTableId(Uint8.ONE);
+        flowBuilder.setOutPort(Uint32.valueOf(42));
         caseBuilder.setMultipartRequestFlow(flowBuilder.build());
         return caseBuilder.build();
     }
index bb00d34e73d56c15babf38c9d399d04fd6d07bad..cc897fff90092096f9b698b318792c1e7db5fc44 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10StatsRequestInputPortStatsFactory.
@@ -53,7 +54,7 @@ public class OF10StatsRequestInputPortStatsFactoryTest {
     private static MultipartRequestBody createMultipartRequestBody() {
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
-        portBuilder.setPortNo(15L);
+        portBuilder.setPortNo(Uint32.valueOf(15));
         caseBuilder.setMultipartRequestPortStats(portBuilder.build());
         return caseBuilder.build();
     }
index 5d2772b2d27595cb220682bd0d9160a6fdfd0257..d9121e6d92bbdf8bccb9649c2bcbbd41c39f2ab8 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestQueueCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10StatsRequestInputQueueFactory.
@@ -53,8 +54,8 @@ public class OF10StatsRequestInputQueueFactoryTest {
     private static MultipartRequestBody createMultipartRequestBody() {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
-        queueBuilder.setPortNo(15L);
-        queueBuilder.setQueueId(16L);
+        queueBuilder.setPortNo(Uint32.valueOf(15));
+        queueBuilder.setQueueId(Uint32.valueOf(16));
         caseBuilder.setMultipartRequestQueue(queueBuilder.build());
         return caseBuilder.build();
     }
index 9c19c725ad6ed213a9aa4e401d919464a7fb43de..87ddd5a145c6abc2da3dc1bf5deb13325f98a687 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.protocol.impl.deserialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -22,6 +21,7 @@ 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.common.types.rev130731.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PacketInMessageFactory.
@@ -57,7 +57,7 @@ public class PacketInMessageFactoryTest {
         Assert.assertEquals("Wrong bufferID", 0x00010203L, builtByFactory.getBufferId().longValue());
         Assert.assertEquals("Wrong totalLength", 0x0102, builtByFactory.getTotalLen().intValue());
         Assert.assertEquals("Wrong reason", PacketInReason.OFPRACTION, builtByFactory.getReason());
-        Assert.assertEquals("Wrong tableID", new TableId(4L), builtByFactory.getTableId());
+        Assert.assertEquals("Wrong tableID", new TableId(Uint32.valueOf(4)), builtByFactory.getTableId());
         Assert.assertEquals("Wrong cookie", 0x0001020304050607L, builtByFactory.getCookie().longValue());
         Assert.assertArrayEquals("Wrong data", ByteBufUtils.hexStringToBytes("01 02 03 04"), builtByFactory.getData());
     }
index ddcc34225189af04ca187edfe3ad0128bacdc240..db549547b02b8d59765db04fe07c43d0aa4de31e 100644 (file)
@@ -28,6 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PacketOutInputMessageFactory.
@@ -56,7 +58,7 @@ public class PacketOutInputMessageFactoryTest {
         BufferHelper.checkHeaderV13(deserializedMessage);
 
         Assert.assertEquals("Wrong buffer Id", 256L, deserializedMessage.getBufferId().longValue());
-        Assert.assertEquals("Wrong In Port", new PortNumber(256L), deserializedMessage.getInPort());
+        Assert.assertEquals("Wrong In Port", new PortNumber(Uint32.valueOf(256)), deserializedMessage.getInPort());
         Assert.assertEquals("Wrong Numbers of actions", createAction(), deserializedMessage.getAction());
         byte[] data = ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14");
         Assert.assertArrayEquals("Wrong data", data, deserializedMessage.getData());
@@ -67,7 +69,7 @@ public class PacketOutInputMessageFactoryTest {
         ActionBuilder actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
-        pushVlanBuilder.setEthertype(new EtherType(new EtherType(25)));
+        pushVlanBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(25))));
         pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
         actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
         actions.add(actionBuilder.build());
index f9032d6e87986d5e8c4fca3818554a31b57c10d0..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.
@@ -47,13 +48,11 @@ public class PortModInputMessageFactoryTest {
         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());
-
     }
-
 }
index 771679420f4c3761d9df77b31e4ef092df2427e8..41e7b1a93773ac32df8394776bac3aca7f310fda 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for TableModInputMessageFactory.
@@ -45,7 +46,7 @@ public class TableModInputMessageFactoryTest {
         TableModInput deserializedMessage = BufferHelper.deserialize(factory, bb);
         BufferHelper.checkHeaderV13(deserializedMessage);
         // Test Message
-        Assert.assertEquals("Wrong table id ", new TableId(9L), deserializedMessage.getTableId());
+        Assert.assertEquals("Wrong table id ", new TableId(Uint32.valueOf(9)), deserializedMessage.getTableId());
         Assert.assertEquals("Wrong config ", new TableConfig(true), deserializedMessage.getConfig());
     }
 
index 7aefadc0e2a99058ba07066180695cc3ca938478..0ee16853301d95da12c8987662e2ea7ff0c0d14c 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.protocol.impl.serialization;
 
 import static org.junit.Assert.assertEquals;
@@ -16,6 +15,7 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for SerializationFactory.
@@ -34,8 +34,8 @@ public class SerializationFactoryTest {
         final SerializationFactory factory = new SerializationFactory(registry);
         final ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         HelloInputBuilder helloBuilder = new HelloInputBuilder();
-        helloBuilder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
-        helloBuilder.setXid(123456L);
+        helloBuilder.setVersion(EncodeConstants.OF_VERSION_1_0);
+        helloBuilder.setXid(Uint32.valueOf(123456));
         helloBuilder.setElements(null);
         factory.messageToBuffer(EncodeConstants.OF10_VERSION_ID, buffer, helloBuilder.build());
         assertEquals("Serialization failed", EncodeConstants.OFHEADER_SIZE, buffer.readableBytes());
@@ -51,8 +51,8 @@ public class SerializationFactoryTest {
         final SerializationFactory factory = new SerializationFactory(registry);
         final ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         HelloInputBuilder helloBuilder = new HelloInputBuilder();
-        helloBuilder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
-        helloBuilder.setXid(123456L);
+        helloBuilder.setVersion(EncodeConstants.OF_VERSION_1_0);
+        helloBuilder.setXid(Uint32.valueOf(123456));
         helloBuilder.setElements(null);
         factory.messageToBuffer((short) 0, buffer, helloBuilder.build());
     }
index 47b03e1dddc4d80652af33675f18750380d77097..9ff1536e42ac0910f282180f43735c713873f1d0 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for ErrorMessageFactory.
@@ -42,8 +43,8 @@ public class ErrorMessageFactoryTest {
     public void testSerialize() throws Exception {
         ErrorMessageBuilder builder = new ErrorMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setType(10);
-        builder.setCode(20);
+        builder.setType(Uint16.TEN);
+        builder.setCode(Uint16.valueOf(20));
         byte[] data = ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14");
         builder.setData(data);
         ErrorMessage message = builder.build();
index 1624b4e43977c421eaeff7b36c5447446902e347..6877e26e915e902633bb008c7845c36b7d3e17d0 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.protocol.impl.serialization.factories;
 
 import static org.mockito.ArgumentMatchers.any;
@@ -26,6 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterOfMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for ExperimenterInputMessageFactory.
@@ -68,8 +68,8 @@ public class ExperimenterInputMessageFactoryTest {
         startUp(true);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setExperimenter(new ExperimenterId(42L));
-        builder.setExpType(21L);
+        builder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        builder.setExpType(Uint32.valueOf(21));
         builder.setExperimenterDataOfChoice(vendorData);
         ExperimenterInput input = builder.build();
 
@@ -85,8 +85,8 @@ public class ExperimenterInputMessageFactoryTest {
         startUp(true);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setExperimenter(new ExperimenterId(42L));
-        builder.setExpType(22L);
+        builder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        builder.setExpType(Uint32.valueOf(22));
         builder.setExperimenterDataOfChoice(vendorData);
         ExperimenterInput input = builder.build();
 
@@ -102,8 +102,8 @@ public class ExperimenterInputMessageFactoryTest {
         startUp(false);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setExperimenter(new ExperimenterId(42L));
-        builder.setExpType(21L);
+        builder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        builder.setExpType(Uint32.valueOf(21));
         builder.setExperimenterDataOfChoice(vendorData);
         ExperimenterInput input = builder.build();
 
@@ -123,8 +123,8 @@ public class ExperimenterInputMessageFactoryTest {
         startUp(false);
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setExperimenter(new ExperimenterId(42L));
-        builder.setExpType(21L);
+        builder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        builder.setExpType(Uint32.valueOf(21));
         builder.setExperimenterDataOfChoice(vendorData);
         ExperimenterInput input = builder.build();
 
index f57b38ba2bf6f0e59a5e85bdb99ddce94c46efe5..08f638f8359be91d82736015b588503fb29be08a 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -51,7 +50,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for FlowModInputMessageFactory.
@@ -84,17 +86,17 @@ public class FlowModInputMessageFactoryTest {
         FlowModInputBuilder builder = new FlowModInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
-        builder.setCookie(new BigInteger(1, cookie));
+        builder.setCookie(Uint64.valueOf(new BigInteger(1, cookie)));
         byte[] cookieMask = new byte[]{(byte) 0xFF, 0x05, 0x00, 0x00, 0x09, 0x30, 0x00, 0x30};
-        builder.setCookieMask(new BigInteger(1, cookieMask));
-        builder.setTableId(new TableId(65L));
+        builder.setCookieMask(Uint64.valueOf(new BigInteger(1, cookieMask)));
+        builder.setTableId(new TableId(Uint32.valueOf(65)));
         builder.setCommand(FlowModCommand.forValue(2));
-        builder.setIdleTimeout(12);
-        builder.setHardTimeout(0);
-        builder.setPriority(126);
-        builder.setBufferId(2L);
-        builder.setOutPort(new PortNumber(4422L));
-        builder.setOutGroup(98L);
+        builder.setIdleTimeout(Uint16.valueOf(12));
+        builder.setHardTimeout(Uint16.ZERO);
+        builder.setPriority(Uint16.valueOf(126));
+        builder.setBufferId(Uint32.TWO);
+        builder.setOutPort(new PortNumber(Uint32.valueOf(4422)));
+        builder.setOutGroup(Uint32.valueOf(98));
         builder.setFlags(new FlowModFlags(true, false, true, false, true));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
@@ -105,7 +107,7 @@ public class FlowModInputMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -114,7 +116,7 @@ public class FlowModInputMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 4);
+        ipEcnBuilder.setEcn(Uint8.valueOf(4));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -124,7 +126,7 @@ public class FlowModInputMessageFactoryTest {
         InstructionBuilder insBuilder = new InstructionBuilder();
         GotoTableCaseBuilder goToCaseBuilder = new GotoTableCaseBuilder();
         GotoTableBuilder instructionBuilder = new GotoTableBuilder();
-        instructionBuilder.setTableId((short) 43);
+        instructionBuilder.setTableId(Uint8.valueOf(43));
         goToCaseBuilder.setGotoTable(instructionBuilder.build());
         insBuilder.setInstructionChoice(goToCaseBuilder.build());
         instructions.add(insBuilder.build());
@@ -142,8 +144,8 @@ public class FlowModInputMessageFactoryTest {
         final ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(52);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(52));
         caseBuilder.setOutputAction(outputBuilder.build());
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
index 4a425ae9afe0f74054831e21b499a5ac970a00cd..c459ba38b783d3e5ccbf6c68ccb2907e1645e874 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -37,6 +36,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for FlowRemovedMessageFactory.
@@ -59,16 +62,16 @@ public class FlowRemovedMessageFactoryTest {
     public void testSerialize() throws Exception {
         FlowRemovedMessageBuilder builder = new FlowRemovedMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setCookie(BigInteger.valueOf(1234L));
-        builder.setPriority(1234);
+        builder.setCookie(Uint64.valueOf(1234));
+        builder.setPriority(Uint16.valueOf(1234));
         builder.setReason(FlowRemovedReason.forValue(2));
-        builder.setTableId(new TableId(65L));
-        builder.setDurationSec(1234L);
-        builder.setDurationNsec(1234L);
-        builder.setIdleTimeout(1234);
-        builder.setHardTimeout(1234);
-        builder.setPacketCount(BigInteger.valueOf(1234L));
-        builder.setByteCount(BigInteger.valueOf(1234L));
+        builder.setTableId(new TableId(Uint32.valueOf(65)));
+        builder.setDurationSec(Uint32.valueOf(1234));
+        builder.setDurationNsec(Uint32.valueOf(1234));
+        builder.setIdleTimeout(Uint16.valueOf(1234));
+        builder.setHardTimeout(Uint16.valueOf(1234));
+        builder.setPacketCount(Uint64.valueOf(1234));
+        builder.setByteCount(Uint64.valueOf(1234));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
         final List<MatchEntry> entries = new ArrayList<>();
@@ -78,7 +81,7 @@ public class FlowRemovedMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -87,7 +90,7 @@ public class FlowRemovedMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 4);
+        ipEcnBuilder.setEcn(Uint8.valueOf(4));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entriesBuilder.build());
index c14aba571e9fa4f74d1d025f110466d89c821532..b169cdbcfaa035ca648a58d51ef1ddd937962276 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for GetConfigReplyMessageFactory.
@@ -43,7 +44,7 @@ public class GetConfigReplyMessageFactoryTest {
         GetConfigOutputBuilder builder = new GetConfigOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setFlags(SwitchConfigFlag.forValue(2));
-        builder.setMissSendLen(20);
+        builder.setMissSendLen(Uint16.valueOf(20));
         GetConfigOutput message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
index 271933d3459f7293a57fb8d7c36555897b145dc4..65953bfb8a1b231084b0ccfceca4cfbb0758bada 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -22,6 +21,9 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class GetFeaturesOutputFactoryTest {
     private OFSerializer<GetFeaturesOutput> factory;
@@ -40,12 +42,12 @@ public class GetFeaturesOutputFactoryTest {
     public void testSerialize() throws Exception {
         GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setDatapathId(BigInteger.valueOf(1234L));
-        builder.setBuffers(1234L);
-        builder.setTables((short) 12);
-        builder.setAuxiliaryId((short) 12);
+        builder.setDatapathId(Uint64.valueOf(1234));
+        builder.setBuffers(Uint32.valueOf(1234));
+        builder.setTables(Uint8.valueOf(12));
+        builder.setAuxiliaryId(Uint8.valueOf(12));
         builder.setCapabilities(new Capabilities(true, false, true, false, true, false, true));
-        builder.setReserved(1234L);
+        builder.setReserved(Uint32.valueOf(1234));
         GetFeaturesOutput message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -64,13 +66,13 @@ public class GetFeaturesOutputFactoryTest {
     }
 
     private static Capabilities createCapabilities(int input) {
-        final Boolean one = (input & (1 << 0)) > 0;
-        final Boolean two = (input & (1 << 1)) > 0;
-        final Boolean three = (input & (1 << 2)) > 0;
-        final Boolean four = (input & (1 << 3)) > 0;
-        final Boolean five = (input & (1 << 5)) > 0;
-        final Boolean six = (input & (1 << 6)) > 0;
-        final Boolean seven = (input & (1 << 8)) > 0;
+        final Boolean one = (input & 1 << 0) > 0;
+        final Boolean two = (input & 1 << 1) > 0;
+        final Boolean three = (input & 1 << 2) > 0;
+        final Boolean four = (input & 1 << 3) > 0;
+        final Boolean five = (input & 1 << 5) > 0;
+        final Boolean six = (input & 1 << 6) > 0;
+        final Boolean seven = (input & 1 << 8) > 0;
         return new Capabilities(one, four, five, seven, three, six, two);
     }
 }
index 458cdb4130f6fb716d2ccc6d5fd641d2d1ec1666..3e79f637f9d63a82b7c974de08df1258d8bfcf3a 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -22,6 +21,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for GetQueueConfigInputMessageFactory.
@@ -53,7 +53,7 @@ public class GetQueueConfigInputMessageFactoryTest {
     public void testGetQueueConfigInputMessage() throws Exception {
         GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setPort(new PortNumber(0x00010203L));
+        builder.setPort(new PortNumber(Uint32.valueOf(0x00010203)));
         GetQueueConfigInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
index fac07f4221e9010173e6754f0c3fbab9b3a86d76..7c3f003745e2e89df7d2642bbc7a540321f2cced 100644 (file)
@@ -27,6 +27,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for GroupModInputMessageFactory.
@@ -58,7 +60,7 @@ public class GroupModInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setCommand(GroupModCommand.forValue(2));
         builder.setType(GroupType.forValue(3));
-        builder.setGroupId(new GroupId(256L));
+        builder.setGroupId(new GroupId(Uint32.valueOf(256)));
         List<BucketsList> exp = createBucketsList();
         builder.setBucketsList(exp);
         final GroupModInput message = builder.build();
@@ -88,9 +90,9 @@ public class GroupModInputMessageFactoryTest {
     private static List<BucketsList> createBucketsList() {
         final List<BucketsList> bucketsList = new ArrayList<>();
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
-        bucketsBuilder.setWeight(10);
-        bucketsBuilder.setWatchPort(new PortNumber(65L));
-        bucketsBuilder.setWatchGroup(22L);
+        bucketsBuilder.setWeight(Uint16.TEN);
+        bucketsBuilder.setWatchPort(new PortNumber(Uint32.valueOf(65)));
+        bucketsBuilder.setWatchGroup(Uint32.valueOf(22));
         BucketsList bucket = bucketsBuilder.build();
         bucketsList.add(bucket);
         return bucketsList;
@@ -100,9 +102,9 @@ public class GroupModInputMessageFactoryTest {
         final List<BucketsList> bucketsList = new ArrayList<>();
         BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
         out.skipBytes(Short.BYTES);
-        bucketsBuilder.setWeight(out.readUnsignedShort());
-        bucketsBuilder.setWatchPort(new PortNumber(out.readUnsignedInt()));
-        bucketsBuilder.setWatchGroup(out.readUnsignedInt());
+        bucketsBuilder.setWeight(Uint16.fromShortBits(out.readShort()));
+        bucketsBuilder.setWatchPort(new PortNumber(Uint32.fromIntBits(out.readInt())));
+        bucketsBuilder.setWatchGroup(Uint32.fromIntBits(out.readInt()));
         out.skipBytes(4);
         BucketsList bucket = bucketsBuilder.build();
         bucketsList.add(bucket);
@@ -118,7 +120,7 @@ public class GroupModInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setCommand(GroupModCommand.forValue(2));
         builder.setType(GroupType.forValue(3));
-        builder.setGroupId(new GroupId(256L));
+        builder.setGroupId(new GroupId(Uint32.valueOf(256)));
         GroupModInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
index 7e0715dc0b0dc912964db406c4b057d1f118913b..4d00442316d5bc0f0b331c9a4995665b9c68f8ec 100644 (file)
@@ -33,6 +33,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.meter.band.dscp.remark._case.MeterBandDscpRemarkBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.Bands;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.mod.BandsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MeterModInputMessageFactory.
@@ -65,7 +67,7 @@ public class MeterModInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setCommand(MeterModCommand.forValue(1));
         builder.setFlags(new MeterFlags(false, true, true, false));
-        builder.setMeterId(new MeterId(2248L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(2248)));
         builder.setBands(createBandsList());
         MeterModInput message = builder.build();
 
@@ -94,16 +96,16 @@ public class MeterModInputMessageFactoryTest {
         final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.OFPMBTDROP);
-        dropBand.setRate(1L);
-        dropBand.setBurstSize(2L);
+        dropBand.setRate(Uint32.ONE);
+        dropBand.setBurstSize(Uint32.TWO);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
         final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.OFPMBTDSCPREMARK);
-        dscpRemarkBand.setRate(1L);
-        dscpRemarkBand.setBurstSize(2L);
-        dscpRemarkBand.setPrecLevel((short) 3);
+        dscpRemarkBand.setRate(Uint32.ONE);
+        dscpRemarkBand.setBurstSize(Uint32.TWO);
+        dscpRemarkBand.setPrecLevel(Uint8.valueOf(3));
         dscpCaseBuilder.setMeterBandDscpRemark(dscpRemarkBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build());
         return bandsList;
@@ -116,8 +118,8 @@ public class MeterModInputMessageFactoryTest {
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
-        dropBand.setRate(input.readUnsignedInt());
-        dropBand.setBurstSize(input.readUnsignedInt());
+        dropBand.setRate(Uint32.fromIntBits(input.readInt()));
+        dropBand.setBurstSize(Uint32.fromIntBits(input.readInt()));
         input.skipBytes(4);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
@@ -125,9 +127,9 @@ public class MeterModInputMessageFactoryTest {
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
-        dscpRemarkBand.setRate(input.readUnsignedInt());
-        dscpRemarkBand.setBurstSize(input.readUnsignedInt());
-        dscpRemarkBand.setPrecLevel(input.readUnsignedByte());
+        dscpRemarkBand.setRate(Uint32.fromIntBits(input.readInt()));
+        dscpRemarkBand.setBurstSize(Uint32.fromIntBits(input.readInt()));
+        dscpRemarkBand.setPrecLevel(Uint8.fromByteBits(input.readByte()));
         input.skipBytes(3);
         dscpCaseBuilder.setMeterBandDscpRemark(dscpRemarkBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build());
@@ -143,7 +145,7 @@ public class MeterModInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setCommand(MeterModCommand.forValue(1));
         builder.setFlags(new MeterFlags(false, true, true, false));
-        builder.setMeterId(new MeterId(2248L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(2248)));
         builder.setBands(null);
         MeterModInput message = builder.build();
 
index d6db32666398dd8970f694b8e07d5559861f139a..e0693f66357395bd5f288758fbcec6eacdb0761b 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -171,7 +170,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
@@ -203,12 +204,12 @@ public class MultipartReplyMessageFactoryTest {
         final MultipartReplyTableFeaturesBuilder featuresBuilder = new MultipartReplyTableFeaturesBuilder();
         final List<TableFeatures> tableFeaturesList = new ArrayList<>();
         TableFeaturesBuilder tableFeaturesBuilder = new TableFeaturesBuilder();
-        tableFeaturesBuilder.setTableId((short) 8);
+        tableFeaturesBuilder.setTableId(Uint8.valueOf(8));
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
         tableFeaturesBuilder.setMetadataMatch(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01 });
         tableFeaturesBuilder.setMetadataWrite(new byte[] { 0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01 });
         tableFeaturesBuilder.setConfig(new TableConfig(true));
-        tableFeaturesBuilder.setMaxEntries(65L);
+        tableFeaturesBuilder.setMaxEntries(Uint32.valueOf(65));
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLES);
         propBuilder.addAugmentation(new NextTableRelatedTableFeaturePropertyBuilder()
@@ -256,14 +257,14 @@ public class MultipartReplyMessageFactoryTest {
         tableFeaturesBuilder.setTableFeatureProperties(properties);
         tableFeaturesList.add(tableFeaturesBuilder.build());
         tableFeaturesBuilder = new TableFeaturesBuilder();
-        tableFeaturesBuilder.setTableId((short) 8);
+        tableFeaturesBuilder.setTableId(Uint8.valueOf(8));
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
         byte[] metadataMatch = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01 };
         tableFeaturesBuilder.setMetadataMatch(metadataMatch);
         byte[] metadataWrite = new byte[] { 0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01 };
         tableFeaturesBuilder.setMetadataWrite(metadataWrite);
         tableFeaturesBuilder.setConfig(new TableConfig(true));
-        tableFeaturesBuilder.setMaxEntries(67L);
+        tableFeaturesBuilder.setMaxEntries(Uint32.valueOf(67));
         properties = new ArrayList<>();
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITEACTIONS);
@@ -504,11 +505,11 @@ public class MultipartReplyMessageFactoryTest {
         builder.setType(MultipartType.forValue(11));
         final MultipartReplyMeterFeaturesCaseBuilder meterFeaturesCase = new MultipartReplyMeterFeaturesCaseBuilder();
         MultipartReplyMeterFeaturesBuilder meterFeatures = new MultipartReplyMeterFeaturesBuilder();
-        meterFeatures.setMaxMeter(1L);
+        meterFeatures.setMaxMeter(Uint32.ONE);
         meterFeatures.setBandTypes(new MeterBandTypeBitmap(true, false));
         meterFeatures.setCapabilities(new MeterFlags(true, false, true, false));
-        meterFeatures.setMaxBands((short) 1);
-        meterFeatures.setMaxColor((short) 1);
+        meterFeatures.setMaxBands(Uint8.ONE);
+        meterFeatures.setMaxColor(Uint8.ONE);
         meterFeaturesCase.setMultipartReplyMeterFeatures(meterFeatures.build());
         builder.setMultipartReplyBody(meterFeaturesCase.build());
         MultipartReplyMessage message = builder.build();
@@ -853,9 +854,9 @@ public class MultipartReplyMessageFactoryTest {
         builder.setType(MultipartType.forValue(2));
         final MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder aggregate = new MultipartReplyAggregateBuilder();
-        aggregate.setPacketCount(BigInteger.valueOf(1L));
-        aggregate.setByteCount(BigInteger.valueOf(1L));
-        aggregate.setFlowCount(1L);
+        aggregate.setPacketCount(Uint64.ONE);
+        aggregate.setByteCount(Uint64.ONE);
+        aggregate.setFlowCount(Uint32.ONE);
         aggregateCase.setMultipartReplyAggregate(aggregate.build());
         builder.setMultipartReplyBody(aggregateCase.build());
         MultipartReplyMessage message = builder.build();
@@ -1002,7 +1003,7 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<Ports> createPortList() {
         PortsBuilder builder = new PortsBuilder();
-        builder.setPortNo(1L);
+        builder.setPortNo(Uint32.ONE);
         builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
         builder.setName("Port name");
         builder.setConfig(new PortConfig(true, false, true, false));
@@ -1015,8 +1016,8 @@ public class MultipartReplyMessageFactoryTest {
                 true, false, true, false, true, false));
         builder.setPeerFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true,
                 false, true, false, true, false));
-        builder.setCurrSpeed(1234L);
-        builder.setMaxSpeed(1234L);
+        builder.setCurrSpeed(Uint32.valueOf(1234));
+        builder.setMaxSpeed(Uint32.valueOf(1234));
         List<Ports> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1065,17 +1066,17 @@ public class MultipartReplyMessageFactoryTest {
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
-        dropBand.setRate(input.readUnsignedInt());
-        dropBand.setBurstSize(input.readUnsignedInt());
+        dropBand.setRate(Uint32.fromIntBits(input.readInt()));
+        dropBand.setBurstSize(Uint32.fromIntBits(input.readInt()));
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
         final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.forValue(input.readUnsignedShort()));
         input.skipBytes(Short.SIZE / Byte.SIZE);
-        dscpRemarkBand.setRate(input.readUnsignedInt());
-        dscpRemarkBand.setBurstSize(input.readUnsignedInt());
-        dscpRemarkBand.setPrecLevel((short) 3);
+        dscpRemarkBand.setRate(Uint32.fromIntBits(input.readInt()));
+        dscpRemarkBand.setBurstSize(Uint32.fromIntBits(input.readInt()));
+        dscpRemarkBand.setPrecLevel(Uint8.valueOf(3));
         dscpCaseBuilder.setMeterBandDscpRemark(dscpRemarkBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build());
         return bandsList;
@@ -1084,7 +1085,7 @@ public class MultipartReplyMessageFactoryTest {
     private static List<MeterConfig> createMeterConfig() {
         MeterConfigBuilder builder = new MeterConfigBuilder();
         builder.setFlags(new MeterFlags(true, false, true, false));
-        builder.setMeterId(new MeterId(1L));
+        builder.setMeterId(new MeterId(Uint32.ONE));
         builder.setBands(createBandsList());
         List<MeterConfig> list = new ArrayList<>();
         list.add(builder.build());
@@ -1103,16 +1104,16 @@ public class MultipartReplyMessageFactoryTest {
         final MeterBandDropCaseBuilder dropCaseBuilder = new MeterBandDropCaseBuilder();
         MeterBandDropBuilder dropBand = new MeterBandDropBuilder();
         dropBand.setType(MeterBandType.OFPMBTDROP);
-        dropBand.setRate(1L);
-        dropBand.setBurstSize(2L);
+        dropBand.setRate(Uint32.ONE);
+        dropBand.setBurstSize(Uint32.TWO);
         dropCaseBuilder.setMeterBandDrop(dropBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dropCaseBuilder.build()).build());
         final MeterBandDscpRemarkCaseBuilder dscpCaseBuilder = new MeterBandDscpRemarkCaseBuilder();
         MeterBandDscpRemarkBuilder dscpRemarkBand = new MeterBandDscpRemarkBuilder();
         dscpRemarkBand.setType(MeterBandType.OFPMBTDSCPREMARK);
-        dscpRemarkBand.setRate(1L);
-        dscpRemarkBand.setBurstSize(2L);
-        dscpRemarkBand.setPrecLevel((short) 3);
+        dscpRemarkBand.setRate(Uint32.ONE);
+        dscpRemarkBand.setBurstSize(Uint32.ONE);
+        dscpRemarkBand.setPrecLevel(Uint8.valueOf(3));
         dscpCaseBuilder.setMeterBandDscpRemark(dscpRemarkBand.build());
         bandsList.add(bandsBuilder.setMeterBand(dscpCaseBuilder.build()).build());
         return bandsList;
@@ -1128,12 +1129,12 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<MeterStats> createMeterStats() {
         MeterStatsBuilder builder = new MeterStatsBuilder();
-        builder.setMeterId(new MeterId(1L));
-        builder.setFlowCount(1L);
-        builder.setPacketInCount(BigInteger.valueOf(1L));
-        builder.setByteInCount(BigInteger.valueOf(1L));
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
+        builder.setMeterId(new MeterId(Uint32.ONE));
+        builder.setFlowCount(Uint32.ONE);
+        builder.setPacketInCount(Uint64.ONE);
+        builder.setByteInCount(Uint64.ONE);
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
         builder.setMeterBandStats(createMeterBandStats());
         List<MeterStats> list = new ArrayList<>();
         list.add(builder.build());
@@ -1142,8 +1143,8 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<MeterBandStats> createMeterBandStats() {
         MeterBandStatsBuilder builder = new MeterBandStatsBuilder();
-        builder.setPacketBandCount(BigInteger.valueOf(1L));
-        builder.setByteBandCount(BigInteger.valueOf(1L));
+        builder.setPacketBandCount(Uint64.ONE);
+        builder.setByteBandCount(Uint64.ONE);
         List<MeterBandStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1208,7 +1209,7 @@ public class MultipartReplyMessageFactoryTest {
     private static List<GroupDesc> createGroupDesc() {
         GroupDescBuilder builder = new GroupDescBuilder();
         builder.setType(GroupType.forValue(1));
-        builder.setGroupId(new GroupId(1L));
+        builder.setGroupId(new GroupId(Uint32.ONE));
         builder.setBucketsList(createBucketsList());
         List<GroupDesc> list = new ArrayList<>();
         list.add(builder.build());
@@ -1217,12 +1218,12 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<GroupStats> createGroupStats() {
         GroupStatsBuilder builder = new GroupStatsBuilder();
-        builder.setGroupId(new GroupId(1L));
-        builder.setRefCount(1L);
-        builder.setPacketCount(BigInteger.valueOf(1L));
-        builder.setByteCount(BigInteger.valueOf(1L));
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
+        builder.setGroupId(new GroupId(Uint32.ONE));
+        builder.setRefCount(Uint32.ONE);
+        builder.setPacketCount(Uint64.ONE);
+        builder.setByteCount(Uint64.ONE);
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
         builder.setBucketStats(createBucketStats());
         List<GroupStats> list = new ArrayList<>();
         list.add(builder.build());
@@ -1231,9 +1232,9 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<BucketsList> createBucketsList() {
         BucketsListBuilder builder = new BucketsListBuilder();
-        builder.setWeight(1);
-        builder.setWatchPort(new PortNumber(1L));
-        builder.setWatchGroup(1L);
+        builder.setWeight(Uint16.ONE);
+        builder.setWatchPort(new PortNumber(Uint32.ONE));
+        builder.setWatchGroup(Uint32.ONE);
         builder.setAction(createActionList());
         List<BucketsList> list = new ArrayList<>();
         list.add(builder.build());
@@ -1244,8 +1245,8 @@ public class MultipartReplyMessageFactoryTest {
         final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(45L));
-        outputBuilder.setMaxLength(55);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(45)));
+        outputBuilder.setMaxLength(Uint16.valueOf(55));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -1253,7 +1254,7 @@ public class MultipartReplyMessageFactoryTest {
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
         SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
-        ttlActionBuilder.setNwTtl((short) 64);
+        ttlActionBuilder.setNwTtl(Uint8.valueOf(64));
         ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
         actionBuilder.setActionChoice(ttlCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -1262,8 +1263,8 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<BucketStats> createBucketStats() {
         BucketStatsBuilder builder = new BucketStatsBuilder();
-        builder.setPacketCount(BigInteger.valueOf(1L));
-        builder.setByteCount(BigInteger.valueOf(1L));
+        builder.setPacketCount(Uint64.ONE);
+        builder.setByteCount(Uint64.ONE);
         List<BucketStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1271,13 +1272,13 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<QueueStats> createQueueStats() {
         QueueStatsBuilder builder = new QueueStatsBuilder();
-        builder.setPortNo(1L);
-        builder.setQueueId(1L);
-        builder.setTxBytes(BigInteger.valueOf(1L));
-        builder.setTxPackets(BigInteger.valueOf(1L));
-        builder.setTxErrors(BigInteger.valueOf(1L));
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
+        builder.setPortNo(Uint32.ONE);
+        builder.setQueueId(Uint32.ONE);
+        builder.setTxBytes(Uint64.ONE);
+        builder.setTxPackets(Uint64.ONE);
+        builder.setTxErrors(Uint64.ONE);
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
         List<QueueStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1285,21 +1286,21 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<PortStats> createPortStats() {
         PortStatsBuilder builder = new PortStatsBuilder();
-        builder.setPortNo(1L);
-        builder.setRxPackets(BigInteger.valueOf(1L));
-        builder.setTxPackets(BigInteger.valueOf(1L));
-        builder.setRxBytes(BigInteger.valueOf(1L));
-        builder.setTxBytes(BigInteger.valueOf(1L));
-        builder.setRxDropped(BigInteger.valueOf(1L));
-        builder.setTxDropped(BigInteger.valueOf(1L));
-        builder.setRxErrors(BigInteger.valueOf(1L));
-        builder.setTxErrors(BigInteger.valueOf(1L));
-        builder.setRxFrameErr(BigInteger.valueOf(1L));
-        builder.setRxOverErr(BigInteger.valueOf(1L));
-        builder.setRxCrcErr(BigInteger.valueOf(1L));
-        builder.setCollisions(BigInteger.valueOf(1L));
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
+        builder.setPortNo(Uint32.ONE);
+        builder.setRxPackets(Uint64.ONE);
+        builder.setTxPackets(Uint64.ONE);
+        builder.setRxBytes(Uint64.ONE);
+        builder.setTxBytes(Uint64.ONE);
+        builder.setRxDropped(Uint64.ONE);
+        builder.setTxDropped(Uint64.ONE);
+        builder.setRxErrors(Uint64.ONE);
+        builder.setTxErrors(Uint64.ONE);
+        builder.setRxFrameErr(Uint64.ONE);
+        builder.setRxOverErr(Uint64.ONE);
+        builder.setRxCrcErr(Uint64.ONE);
+        builder.setCollisions(Uint64.ONE);
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
         List<PortStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1307,10 +1308,10 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<TableStats> createTableStats() {
         TableStatsBuilder builder = new TableStatsBuilder();
-        builder.setTableId((short) 1);
-        builder.setActiveCount(1L);
-        builder.setLookupCount(BigInteger.valueOf(1L));
-        builder.setMatchedCount(BigInteger.valueOf(1L));
+        builder.setTableId(Uint8.ONE);
+        builder.setActiveCount(Uint32.ONE);
+        builder.setLookupCount(Uint64.ONE);
+        builder.setMatchedCount(Uint64.ONE);
         List<TableStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -1318,15 +1319,15 @@ public class MultipartReplyMessageFactoryTest {
 
     private static List<FlowStats> createFlowStats() {
         FlowStatsBuilder builder = new FlowStatsBuilder();
-        builder.setTableId((short) 1);
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
-        builder.setPriority(1);
-        builder.setIdleTimeout(1);
-        builder.setHardTimeout(1);
-        builder.setCookie(BigInteger.valueOf(1234L));
-        builder.setPacketCount(BigInteger.valueOf(1234L));
-        builder.setByteCount(BigInteger.valueOf(1234L));
+        builder.setTableId(Uint8.ONE);
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
+        builder.setPriority(Uint16.ONE);
+        builder.setIdleTimeout(Uint16.ONE);
+        builder.setHardTimeout(Uint16.ONE);
+        builder.setCookie(Uint64.valueOf(1234));
+        builder.setPacketCount(Uint64.valueOf(1234));
+        builder.setByteCount(Uint64.valueOf(1234));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
         final List<MatchEntry> entries = new ArrayList<>();
@@ -1336,7 +1337,7 @@ public class MultipartReplyMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -1345,7 +1346,7 @@ public class MultipartReplyMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 4);
+        ipEcnBuilder.setEcn(Uint8.valueOf(4));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -1356,7 +1357,7 @@ public class MultipartReplyMessageFactoryTest {
         InstructionBuilder builderInstruction = new InstructionBuilder();
         GotoTableCaseBuilder gotoCaseBuilder = new GotoTableCaseBuilder();
         GotoTableBuilder instructionBuilder = new GotoTableBuilder();
-        instructionBuilder.setTableId((short) 5);
+        instructionBuilder.setTableId(Uint8.valueOf(5));
         gotoCaseBuilder.setGotoTable(instructionBuilder.build());
         builderInstruction.setInstructionChoice(gotoCaseBuilder.build());
         instructions.add(builderInstruction.build());
@@ -1377,7 +1378,7 @@ public class MultipartReplyMessageFactoryTest {
         builderInstruction = new InstructionBuilder();
         MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
         MeterBuilder meterBuilder = new MeterBuilder();
-        meterBuilder.setMeterId(42L);
+        meterBuilder.setMeterId(Uint32.valueOf(42));
         meterCaseBuilder.setMeter(meterBuilder.build());
         builderInstruction.setInstructionChoice(meterCaseBuilder.build());
         instructions.add(builderInstruction.build());
@@ -1387,8 +1388,8 @@ public class MultipartReplyMessageFactoryTest {
         final WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(45L));
-        outputBuilder.setMaxLength(55);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(45)));
+        outputBuilder.setMaxLength(Uint16.valueOf(55));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -1397,7 +1398,7 @@ public class MultipartReplyMessageFactoryTest {
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
         SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
-        ttlActionBuilder.setNwTtl((short) 64);
+        ttlActionBuilder.setNwTtl(Uint8.valueOf(64));
         ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
         actionBuilder.setActionChoice(ttlCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -1413,7 +1414,7 @@ public class MultipartReplyMessageFactoryTest {
         actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder vlanBuilder = new PushVlanActionBuilder();
-        vlanBuilder.setEthertype(new EtherType(new EtherType(14)));
+        vlanBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(14))));
         vlanCaseBuilder.setPushVlanAction(vlanBuilder.build());
         actionBuilder.setActionChoice(vlanCaseBuilder.build());
         actions.add(actionBuilder.build());
index 0961aa76a6bc99529b8efd0e372559f132f65b5c..0fc7bd63945a90ec3cab8d003c131733f7c3cb44 100644 (file)
@@ -5,12 +5,10 @@
  * 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -50,6 +48,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.meter.config._case.MultipartRequestMeterConfigBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MultipartRequestInputFactory.
@@ -108,13 +109,11 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestFlowCase createRequestFlow() {
         final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
         MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
-        builder.setTableId((short) 8);
-        builder.setOutPort(85L);
-        builder.setOutGroup(95L);
-        byte[] cookie = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setTableId(Uint8.valueOf(8));
+        builder.setOutPort(Uint32.valueOf(85));
+        builder.setOutGroup(Uint32.valueOf(95));
+        builder.setCookie(Uint64.valueOf("0001010101010101", 16));
+        builder.setCookieMask(Uint64.valueOf("0001010101010101", 16));
         caseBuilder.setMultipartRequestFlow(builder.build());
         //TODO match field
         return caseBuilder.build();
@@ -123,17 +122,13 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestFlowCase decodeRequestFlow(ByteBuf output) {
         final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
         MultipartRequestFlowBuilder builder = new MultipartRequestFlowBuilder();
-        builder.setTableId(output.readUnsignedByte());
+        builder.setTableId(Uint8.fromByteBits(output.readByte()));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
-        builder.setOutPort(output.readUnsignedInt());
-        builder.setOutGroup(output.readUnsignedInt());
+        builder.setOutPort(Uint32.fromIntBits(output.readInt()));
+        builder.setOutGroup(Uint32.fromIntBits(output.readInt()));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
-        byte[] cookie = new byte[Long.BYTES];
-        output.readBytes(cookie);
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[Long.BYTES];
-        output.readBytes(cookieMask);
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setCookie(Uint64.fromLongBits(output.readLong()));
+        builder.setCookieMask(Uint64.fromLongBits(output.readLong()));
         caseBuilder.setMultipartRequestFlow(builder.build());
         return caseBuilder.build();
     }
@@ -170,32 +165,26 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestAggregateCase createRequestAggregate() {
         final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
         MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
-        builder.setTableId((short) 8);
-        builder.setOutPort(85L);
-        builder.setOutGroup(95L);
-        byte[] cookie = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[]{0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setTableId(Uint8.valueOf(8));
+        builder.setOutPort(Uint32.valueOf(85));
+        builder.setOutGroup(Uint32.valueOf(95));
+        builder.setCookie(Uint64.valueOf("0001010101010101", 16));
+        builder.setCookieMask(Uint64.valueOf("0001010101010101", 16));
         caseBuilder.setMultipartRequestAggregate(builder.build());
-      //TODO match field
+        // TODO match field
         return caseBuilder.build();
     }
 
     private static MultipartRequestAggregateCase decodeRequestAggregate(ByteBuf output) {
         final  MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
         MultipartRequestAggregateBuilder builder = new MultipartRequestAggregateBuilder();
-        builder.setTableId(output.readUnsignedByte());
+        builder.setTableId(Uint8.fromByteBits(output.readByte()));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_01);
-        builder.setOutPort(output.readUnsignedInt());
-        builder.setOutGroup(output.readUnsignedInt());
+        builder.setOutPort(Uint32.fromIntBits(output.readInt()));
+        builder.setOutGroup(Uint32.fromIntBits(output.readInt()));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_AGGREGATE_BODY_02);
-        byte[] cookie = new byte[Long.BYTES];
-        output.readBytes(cookie);
-        builder.setCookie(new BigInteger(1, cookie));
-        byte[] cookieMask = new byte[Long.BYTES];
-        output.readBytes(cookieMask);
-        builder.setCookieMask(new BigInteger(1, cookieMask));
+        builder.setCookie(Uint64.fromLongBits(output.readLong()));
+        builder.setCookieMask(Uint64.fromLongBits(output.readLong()));
         caseBuilder.setMultipartRequestAggregate(builder.build());
         return caseBuilder.build();
     }
@@ -246,7 +235,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestPortStatsCase createRequestPortStats() {
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder builder = new MultipartRequestPortStatsBuilder();
-        builder.setPortNo(2251L);
+        builder.setPortNo(Uint32.valueOf(2251));
         caseBuilder.setMultipartRequestPortStats(builder.build());
         return caseBuilder.build();
     }
@@ -254,7 +243,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestPortStatsCase decodeRequestPortStats(ByteBuf output) {
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder builder = new MultipartRequestPortStatsBuilder();
-        builder.setPortNo(output.readUnsignedInt());
+        builder.setPortNo(Uint32.fromIntBits(output.readInt()));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_PORTSTATS_BODY);
         caseBuilder.setMultipartRequestPortStats(builder.build());
         return caseBuilder.build();
@@ -285,8 +274,8 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestQueueCase createRequestQueue() {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder builder = new MultipartRequestQueueBuilder();
-        builder.setPortNo(2256L);
-        builder.setQueueId(2211L);
+        builder.setPortNo(Uint32.valueOf(2256));
+        builder.setQueueId(Uint32.valueOf(2211));
         caseBuilder.setMultipartRequestQueue(builder.build());
         return caseBuilder.build();
     }
@@ -294,8 +283,8 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestQueueCase decodeRequestQueue(ByteBuf output) {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder builder = new MultipartRequestQueueBuilder();
-        builder.setPortNo(output.readUnsignedInt());
-        builder.setQueueId(output.readUnsignedInt());
+        builder.setPortNo(Uint32.fromIntBits(output.readInt()));
+        builder.setQueueId(Uint32.fromIntBits(output.readInt()));
         caseBuilder.setMultipartRequestQueue(builder.build());
         return caseBuilder.build();
     }
@@ -325,7 +314,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestGroupCase createRequestGroup() {
         MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
         MultipartRequestGroupBuilder builder = new MultipartRequestGroupBuilder();
-        builder.setGroupId(new GroupId(2258L));
+        builder.setGroupId(new GroupId(Uint32.valueOf(2258)));
         caseBuilder.setMultipartRequestGroup(builder.build());
         return caseBuilder.build();
     }
@@ -333,7 +322,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestGroupCase decodeRequestGroup(ByteBuf output) {
         MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
         MultipartRequestGroupBuilder builder = new MultipartRequestGroupBuilder();
-        builder.setGroupId(new GroupId(output.readUnsignedInt()));
+        builder.setGroupId(new GroupId(Uint32.fromIntBits(output.readInt())));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_GROUP_BODY);
         caseBuilder.setMultipartRequestGroup(builder.build());
         return caseBuilder.build();
@@ -364,7 +353,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestMeterCase createRequestMeter() {
         MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
         MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
-        builder.setMeterId(new MeterId(1121L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(1121)));
         caseBuilder.setMultipartRequestMeter(builder.build());
         return caseBuilder.build();
     }
@@ -372,7 +361,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestMeterCase decodeRequestMeter(ByteBuf output) {
         MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
         MultipartRequestMeterBuilder builder = new MultipartRequestMeterBuilder();
-        builder.setMeterId(new MeterId(output.readUnsignedInt()));
+        builder.setMeterId(new MeterId(Uint32.fromIntBits(output.readInt())));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_METER_BODY);
         caseBuilder.setMultipartRequestMeter(builder.build());
         return caseBuilder.build();
@@ -403,7 +392,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestMeterConfigCase createRequestMeterConfig() {
         MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
         MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
-        builder.setMeterId(new MeterId(1133L));
+        builder.setMeterId(new MeterId(Uint32.valueOf(1133)));
         caseBuilder.setMultipartRequestMeterConfig(builder.build());
         return caseBuilder.build();
     }
@@ -411,7 +400,7 @@ public class MultipartRequestInputFactoryTest {
     private static MultipartRequestMeterConfigCase decodeRequestMeterConfig(ByteBuf output) {
         MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
         MultipartRequestMeterConfigBuilder builder = new MultipartRequestMeterConfigBuilder();
-        builder.setMeterId(new MeterId(output.readUnsignedInt()));
+        builder.setMeterId(new MeterId(Uint32.fromIntBits(output.readInt())));
         output.skipBytes(PADDING_IN_MULTIPART_REQUEST_METER_CONFIG_BODY);
         caseBuilder.setMultipartRequestMeterConfig(builder.build());
         return caseBuilder.build();
index 501087ffa9ecc58d0575931288e8af6d2bcdfef3..b0243432ae086cc92572c52bb4b18e13becf08e0 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -32,6 +31,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPortBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10FeaturesReplyMessageFactory.
@@ -54,9 +56,9 @@ public class OF10FeaturesReplyMessageFactoryTest {
     public void testSerialize() throws Exception {
         GetFeaturesOutputBuilder builder = new GetFeaturesOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setDatapathId(BigInteger.valueOf(1L));
-        builder.setBuffers(1L);
-        builder.setTables((short) 1);
+        builder.setDatapathId(Uint64.ONE);
+        builder.setBuffers(Uint32.ONE);
+        builder.setTables(Uint8.ONE);
         builder.setCapabilitiesV10(new CapabilitiesV10(true, false, true, false, true, false, true, false));
         builder.setActionsV10(
                 new ActionTypeV10(true, false, true, false, true, false, true, false, true, false, true, false, true));
@@ -97,7 +99,7 @@ public class OF10FeaturesReplyMessageFactoryTest {
     private static List<PhyPort> createPorts() {
         final List<PhyPort> ports = new ArrayList<>();
         PhyPortBuilder builder = new PhyPortBuilder();
-        builder.setPortNo(1L);
+        builder.setPortNo(Uint32.ONE);
         builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
         builder.setName("Port name");
         builder.setConfigV10(new PortConfigV10(true, false, true, false, true, false, true));
index d65ec2e8e4dd001a0f340205908e6628485a75c1..ae2576be82435845f8328b1e3988e5f5cb784062 100644 (file)
@@ -38,6 +38,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10FlowModInputMessageFactory.
@@ -69,29 +73,29 @@ public class OF10FlowModInputMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 0);
-        matchBuilder.setNwDstMask((short) 0);
-        matchBuilder.setInPort(58);
+        matchBuilder.setNwSrcMask(Uint8.ZERO);
+        matchBuilder.setNwDstMask(Uint8.ZERO);
+        matchBuilder.setInPort(Uint16.valueOf(58));
         matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
-        matchBuilder.setDlVlan(18);
-        matchBuilder.setDlVlanPcp((short) 5);
-        matchBuilder.setDlType(42);
-        matchBuilder.setNwTos((short) 4);
-        matchBuilder.setNwProto((short) 7);
+        matchBuilder.setDlVlan(Uint16.valueOf(18));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(5));
+        matchBuilder.setDlType(Uint16.valueOf(42));
+        matchBuilder.setNwTos(Uint8.valueOf(4));
+        matchBuilder.setNwProto(Uint8.valueOf(7));
         matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
         matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
-        matchBuilder.setTpSrc(6653);
-        matchBuilder.setTpDst(6633);
+        matchBuilder.setTpSrc(Uint16.valueOf(6653));
+        matchBuilder.setTpDst(Uint16.valueOf(6633));
         builder.setMatchV10(matchBuilder.build());
-        byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
-        builder.setCookie(new BigInteger(1, cookie));
+        final byte[] cookie = new byte[]{(byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01};
+        builder.setCookie(Uint64.valueOf(new BigInteger(1, cookie)));
         builder.setCommand(FlowModCommand.forValue(0));
-        builder.setIdleTimeout(12);
-        builder.setHardTimeout(16);
-        builder.setPriority(1);
-        builder.setBufferId(2L);
-        builder.setOutPort(new PortNumber(4422L));
+        builder.setIdleTimeout(Uint16.valueOf(12));
+        builder.setHardTimeout(Uint16.valueOf(16));
+        builder.setPriority(Uint16.ONE);
+        builder.setBufferId(Uint32.TWO);
+        builder.setOutPort(new PortNumber(Uint32.valueOf(4422)));
         builder.setFlagsV10(new FlowModFlagsV10(true, false, true));
         final List<Action> actions = new ArrayList<>();
         ActionBuilder actionBuilder = new ActionBuilder();
@@ -104,7 +108,7 @@ public class OF10FlowModInputMessageFactoryTest {
         actionBuilder = new ActionBuilder();
         SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
         SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
-        tpSrcBuilder.setPort(new PortNumber(42L));
+        tpSrcBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
         tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
         actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
         actions.add(actionBuilder.build());
index bb82cd8dfb59d82b19e59fba79fa4a27715b4d85..c8c9cdf9d25ff046f111da95cfc7e5a4009f7f3a 100644 (file)
@@ -27,6 +27,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10FlowRemovedMessageFactory.
@@ -51,30 +55,30 @@ public class OF10FlowRemovedMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 0);
-        matchBuilder.setNwDstMask((short) 0);
-        matchBuilder.setInPort(58);
+        matchBuilder.setNwSrcMask(Uint8.ZERO);
+        matchBuilder.setNwDstMask(Uint8.ZERO);
+        matchBuilder.setInPort(Uint16.valueOf(58));
         matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
-        matchBuilder.setDlVlan(18);
-        matchBuilder.setDlVlanPcp((short) 5);
-        matchBuilder.setDlType(42);
-        matchBuilder.setNwTos((short) 4);
-        matchBuilder.setNwProto((short) 7);
+        matchBuilder.setDlVlan(Uint16.valueOf(18));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(5));
+        matchBuilder.setDlType(Uint16.valueOf(42));
+        matchBuilder.setNwTos(Uint8.valueOf(4));
+        matchBuilder.setNwProto(Uint8.valueOf(7));
         matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
         matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
-        matchBuilder.setTpSrc(6653);
-        matchBuilder.setTpDst(6633);
+        matchBuilder.setTpSrc(Uint16.valueOf(6653));
+        matchBuilder.setTpDst(Uint16.valueOf(6633));
         builder.setMatchV10(matchBuilder.build());
-        byte[] cookie = new byte[] { (byte) 0xFF, 0x01, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01 };
-        builder.setCookie(new BigInteger(1, cookie));
-        builder.setPriority(1);
+        final byte[] cookie = new byte[] { (byte) 0xFF, 0x01, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01 };
+        builder.setCookie(Uint64.valueOf(new BigInteger(1, cookie)));
+        builder.setPriority(Uint16.ONE);
         builder.setReason(FlowRemovedReason.forValue(1));
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(1L);
-        builder.setIdleTimeout(12);
-        builder.setPacketCount(BigInteger.valueOf(1L));
-        builder.setByteCount(BigInteger.valueOf(2L));
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.ONE);
+        builder.setIdleTimeout(Uint16.valueOf(12));
+        builder.setPacketCount(Uint64.ONE);
+        builder.setByteCount(Uint64.TWO);
         FlowRemovedMessage message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
index ab40cd0704ff54755720db00e1ff607b21379ff7..f85c77a094a0025a91e14e97aa36f77eb8fcfad1 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.
@@ -43,9 +45,9 @@ public class OF10PacketInMessageFactoryTest {
     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);
index e30f397f75126a36809618d03ff2fb2d2ecc9240..e4fd66fd053623b999a50f8dd3e003401fec927e 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -30,6 +29,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10PacketOutInputMessageFactory.
@@ -59,13 +60,13 @@ public class OF10PacketOutInputMessageFactoryTest {
     public void testPacketOutInputMessage() throws Exception {
         PacketOutInputBuilder builder = new PacketOutInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setBufferId(256L);
-        builder.setInPort(new PortNumber(257L));
+        builder.setBufferId(Uint32.valueOf(256));
+        builder.setInPort(new PortNumber(Uint32.valueOf(257)));
         final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(50);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(50));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -105,8 +106,8 @@ public class OF10PacketOutInputMessageFactoryTest {
     public void testPacketOutInputWithNoData() throws Exception {
         PacketOutInputBuilder builder = new PacketOutInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setBufferId(256L);
-        builder.setInPort(new PortNumber(257L));
+        builder.setBufferId(Uint32.valueOf(256));
+        builder.setInPort(new PortNumber(Uint32.valueOf(257)));
         List<Action> actions = new ArrayList<>();
         builder.setAction(actions);
         builder.setData(null);
index 1680df08451f1cdba1a28764b22ed4a1078f4869..a2c4a218228ee9410665ae4f8e1a3c79afac3860 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -26,6 +25,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.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10PortModInputMessageFactory.
@@ -55,7 +55,7 @@ public class OF10PortModInputMessageFactoryTest {
     public void testPortModInput() throws Exception {
         PortModInputBuilder builder = new PortModInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setPortNo(new PortNumber(6633L));
+        builder.setPortNo(new PortNumber(Uint32.valueOf(6633)));
         builder.setHwAddress(new MacAddress("08:00:27:00:B0:EB"));
         builder.setConfigV10(new PortConfigV10(true, false, false, true, false, false, true));
         builder.setMaskV10(new PortConfigV10(false, true, true, false, false, true, false));
@@ -77,5 +77,4 @@ public class OF10PortModInputMessageFactoryTest {
         Assert.assertEquals("Wrong advertise", 652, out.readUnsignedInt());
         out.skipBytes(4);
     }
-
 }
index 30ab3ca8e6ddd7e802202c1024537897586a6350..13e9fbb79607c1511975b68a83388ecea1b56941 100644 (file)
@@ -26,6 +26,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.PortStateV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10PortStatusMessageFactory.
@@ -49,7 +50,7 @@ public class OF10PortStatusMessageFactoryTest {
         PortStatusMessageBuilder builder = new PortStatusMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         builder.setReason(PortReason.forValue(1));
-        builder.setPortNo(1L);
+        builder.setPortNo(Uint32.ONE);
         builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
         builder.setName("Port name");
         builder.setConfigV10(new PortConfigV10(true, false, true, false, true, false, true));
index f0dd4a58c6feb26771a3750b725a5995adeb589b..5951c0068a004eb4495493f5066ba5e2b33b248d 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -22,6 +21,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10QueueGetConfigInputMessageFactory.
@@ -51,7 +51,7 @@ public class OF10QueueGetConfigInputMessageFactoryTest {
     public void test() throws Exception {
         GetQueueConfigInputBuilder builder = new GetQueueConfigInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
-        builder.setPort(new PortNumber(6653L));
+        builder.setPort(new PortNumber(Uint32.valueOf(6653)));
         GetQueueConfigInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
index 155038c44f3045e413036d455b17ca56569643eb..4e444963fa38e9cdc381919a920d618cdd08b3be 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -60,6 +59,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.MultipartReplyTableBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStats;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table._case.multipart.reply.table.TableStatsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10StatsReplyMessageFactory.
@@ -171,9 +174,9 @@ public class OF10StatsReplyMessageFactoryTest {
         builder.setType(MultipartType.forValue(2));
         final MultipartReplyAggregateCaseBuilder aggregateCase = new MultipartReplyAggregateCaseBuilder();
         MultipartReplyAggregateBuilder aggregate = new MultipartReplyAggregateBuilder();
-        aggregate.setPacketCount(BigInteger.valueOf(1234L));
-        aggregate.setByteCount(BigInteger.valueOf(1234L));
-        aggregate.setFlowCount(1L);
+        aggregate.setPacketCount(Uint64.valueOf(1234));
+        aggregate.setByteCount(Uint64.valueOf(1234));
+        aggregate.setFlowCount(Uint32.ONE);
         aggregateCase.setMultipartReplyAggregate(aggregate.build());
         builder.setMultipartReplyBody(aggregateCase.build());
         MultipartReplyMessage message = builder.build();
@@ -299,10 +302,10 @@ public class OF10StatsReplyMessageFactoryTest {
 
     private static List<QueueStats> createQueueStats() {
         QueueStatsBuilder builder = new QueueStatsBuilder();
-        builder.setQueueId(1L);
-        builder.setTxBytes(BigInteger.valueOf(1L));
-        builder.setTxPackets(BigInteger.valueOf(1L));
-        builder.setTxErrors(BigInteger.valueOf(1L));
+        builder.setQueueId(Uint32.ONE);
+        builder.setTxBytes(Uint64.ONE);
+        builder.setTxPackets(Uint64.ONE);
+        builder.setTxErrors(Uint64.ONE);
         List<QueueStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -310,19 +313,19 @@ public class OF10StatsReplyMessageFactoryTest {
 
     private static List<PortStats> createPortStats() {
         PortStatsBuilder builder = new PortStatsBuilder();
-        builder.setPortNo(1L);
-        builder.setRxPackets(BigInteger.valueOf(1L));
-        builder.setTxPackets(BigInteger.valueOf(1L));
-        builder.setRxBytes(BigInteger.valueOf(1L));
-        builder.setTxBytes(BigInteger.valueOf(1L));
-        builder.setRxDropped(BigInteger.valueOf(1L));
-        builder.setTxDropped(BigInteger.valueOf(1L));
-        builder.setRxErrors(BigInteger.valueOf(1L));
-        builder.setTxErrors(BigInteger.valueOf(1L));
-        builder.setRxFrameErr(BigInteger.valueOf(1L));
-        builder.setRxOverErr(BigInteger.valueOf(1L));
-        builder.setRxCrcErr(BigInteger.valueOf(1L));
-        builder.setCollisions(BigInteger.valueOf(1L));
+        builder.setPortNo(Uint32.ONE);
+        builder.setRxPackets(Uint64.ONE);
+        builder.setTxPackets(Uint64.ONE);
+        builder.setRxBytes(Uint64.ONE);
+        builder.setTxBytes(Uint64.ONE);
+        builder.setRxDropped(Uint64.ONE);
+        builder.setTxDropped(Uint64.ONE);
+        builder.setRxErrors(Uint64.ONE);
+        builder.setTxErrors(Uint64.ONE);
+        builder.setRxFrameErr(Uint64.ONE);
+        builder.setRxOverErr(Uint64.ONE);
+        builder.setRxCrcErr(Uint64.ONE);
+        builder.setCollisions(Uint64.ONE);
         List<PortStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -330,13 +333,13 @@ public class OF10StatsReplyMessageFactoryTest {
 
     private static List<TableStats> createTableStats() {
         TableStatsBuilder builder = new TableStatsBuilder();
-        builder.setTableId((short) 1);
+        builder.setTableId(Uint8.ONE);
         builder.setName("Table name");
         builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        builder.setMaxEntries(1L);
-        builder.setActiveCount(1L);
-        builder.setLookupCount(BigInteger.valueOf(1234L));
-        builder.setMatchedCount(BigInteger.valueOf(1234L));
+        builder.setMaxEntries(Uint32.ONE);
+        builder.setActiveCount(Uint32.ONE);
+        builder.setLookupCount(Uint64.valueOf(1234));
+        builder.setMatchedCount(Uint64.valueOf(1234));
         List<TableStats> list = new ArrayList<>();
         list.add(builder.build());
         return list;
@@ -344,38 +347,38 @@ public class OF10StatsReplyMessageFactoryTest {
 
     private static List<FlowStats> createFlowStats() {
         FlowStatsBuilder builder = new FlowStatsBuilder();
-        builder.setTableId((short) 1);
+        builder.setTableId(Uint8.ONE);
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 0);
-        matchBuilder.setNwDstMask((short) 0);
-        matchBuilder.setInPort(58);
+        matchBuilder.setNwSrcMask(Uint8.ZERO);
+        matchBuilder.setNwDstMask(Uint8.ZERO);
+        matchBuilder.setInPort(Uint16.valueOf(58));
         matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
-        matchBuilder.setDlVlan(18);
-        matchBuilder.setDlVlanPcp((short) 5);
-        matchBuilder.setDlType(42);
-        matchBuilder.setNwTos((short) 4);
-        matchBuilder.setNwProto((short) 7);
+        matchBuilder.setDlVlan(Uint16.valueOf(18));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(5));
+        matchBuilder.setDlType(Uint16.valueOf(42));
+        matchBuilder.setNwTos(Uint8.valueOf(4));
+        matchBuilder.setNwProto(Uint8.valueOf(7));
         matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
         matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
-        matchBuilder.setTpSrc(6653);
-        matchBuilder.setTpDst(6633);
+        matchBuilder.setTpSrc(Uint16.valueOf(6653));
+        matchBuilder.setTpDst(Uint16.valueOf(6633));
         builder.setMatchV10(matchBuilder.build());
-        builder.setDurationSec(1L);
-        builder.setDurationNsec(2L);
-        builder.setPriority(1);
-        builder.setIdleTimeout(1);
-        builder.setHardTimeout(1);
-        builder.setCookie(BigInteger.valueOf(1234L));
-        builder.setPacketCount(BigInteger.valueOf(1234L));
-        builder.setByteCount(BigInteger.valueOf(1234L));
+        builder.setDurationSec(Uint32.ONE);
+        builder.setDurationNsec(Uint32.TWO);
+        builder.setPriority(Uint16.ONE);
+        builder.setIdleTimeout(Uint16.ONE);
+        builder.setHardTimeout(Uint16.ONE);
+        builder.setCookie(Uint64.valueOf(1234));
+        builder.setPacketCount(Uint64.valueOf(1234));
+        builder.setByteCount(Uint64.valueOf(1234));
         final List<Action> actions = new ArrayList<>();
         final ActionBuilder actionBuilder = new ActionBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(50);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(50));
         caseBuilder.setOutputAction(outputBuilder.build());
         actionBuilder.setActionChoice(caseBuilder.build());
         actions.add(actionBuilder.build());
index 415f2f9d294147efe180fb66adb4d89762f5a480..3a8d2c85d3e875a75c9d7b2d0774e73cdf99d001 100644 (file)
@@ -37,6 +37,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10StatsRequestInputFactory.
@@ -97,23 +100,23 @@ public class OF10StatsRequestInputFactoryTest {
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true,
                 true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 8);
-        matchBuilder.setNwDstMask((short) 16);
-        matchBuilder.setInPort(51);
+        matchBuilder.setNwSrcMask(Uint8.valueOf(8));
+        matchBuilder.setNwDstMask(Uint8.valueOf(16));
+        matchBuilder.setInPort(Uint16.valueOf(51));
         matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
         matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
-        matchBuilder.setDlVlan(52);
-        matchBuilder.setDlVlanPcp((short) 53);
-        matchBuilder.setDlType(54);
-        matchBuilder.setNwTos((short) 55);
-        matchBuilder.setNwProto((short) 56);
+        matchBuilder.setDlVlan(Uint16.valueOf(52));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(53));
+        matchBuilder.setDlType(Uint16.valueOf(54));
+        matchBuilder.setNwTos(Uint8.valueOf(55));
+        matchBuilder.setNwProto(Uint8.valueOf(56));
         matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
         matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
-        matchBuilder.setTpSrc(57);
-        matchBuilder.setTpDst(58);
+        matchBuilder.setTpSrc(Uint16.valueOf(57));
+        matchBuilder.setTpDst(Uint16.valueOf(58));
         flowBuilder.setMatchV10(matchBuilder.build());
-        flowBuilder.setTableId((short) 1);
-        flowBuilder.setOutPort(42L);
+        flowBuilder.setTableId(Uint8.ONE);
+        flowBuilder.setOutPort(Uint32.valueOf(42));
         caseBuilder.setMultipartRequestFlow(flowBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
         MultipartRequestInput message = builder.build();
@@ -163,23 +166,23 @@ public class OF10StatsRequestInputFactoryTest {
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(false, false, false, false,
                 false, false, false, false, false, false));
-        matchBuilder.setNwSrcMask((short) 32);
-        matchBuilder.setNwDstMask((short) 32);
-        matchBuilder.setInPort(51);
+        matchBuilder.setNwSrcMask(Uint8.valueOf(32));
+        matchBuilder.setNwDstMask(Uint8.valueOf(32));
+        matchBuilder.setInPort(Uint16.valueOf(51));
         matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
         matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
-        matchBuilder.setDlVlan(52);
-        matchBuilder.setDlVlanPcp((short) 53);
-        matchBuilder.setDlType(54);
-        matchBuilder.setNwTos((short) 55);
-        matchBuilder.setNwProto((short) 56);
+        matchBuilder.setDlVlan(Uint16.valueOf(52));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(53));
+        matchBuilder.setDlType(Uint16.valueOf(54));
+        matchBuilder.setNwTos(Uint8.valueOf(55));
+        matchBuilder.setNwProto(Uint8.valueOf(56));
         matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
         matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
-        matchBuilder.setTpSrc(57);
-        matchBuilder.setTpDst(58);
+        matchBuilder.setTpSrc(Uint16.valueOf(57));
+        matchBuilder.setTpDst(Uint16.valueOf(58));
         flowBuilder.setMatchV10(matchBuilder.build());
-        flowBuilder.setTableId((short) 42);
-        flowBuilder.setOutPort(6653L);
+        flowBuilder.setTableId(Uint8.valueOf(42));
+        flowBuilder.setOutPort(Uint32.valueOf(6653));
         caseBuilder.setMultipartRequestFlow(flowBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
         MultipartRequestInput message = builder.build();
@@ -250,7 +253,7 @@ public class OF10StatsRequestInputFactoryTest {
         builder.setFlags(new MultipartRequestFlags(false));
         MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
-        portBuilder.setPortNo(15L);
+        portBuilder.setPortNo(Uint32.valueOf(15));
         caseBuilder.setMultipartRequestPortStats(portBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
         MultipartRequestInput message = builder.build();
@@ -277,8 +280,8 @@ public class OF10StatsRequestInputFactoryTest {
         builder.setFlags(new MultipartRequestFlags(false));
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
-        queueBuilder.setPortNo(15L);
-        queueBuilder.setQueueId(16L);
+        queueBuilder.setPortNo(Uint32.valueOf(15));
+        queueBuilder.setQueueId(Uint32.valueOf(16));
         caseBuilder.setMultipartRequestQueue(queueBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
         MultipartRequestInput message = builder.build();
index f1ac742bd62cd2d0ddd42ae7ee254c642458f381..296c1f3e1b753a85a63219d7ea2f3eea9039f993 100644 (file)
@@ -38,7 +38,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
 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;
 import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for PacketInMessageFactory.
@@ -61,12 +64,11 @@ public class PacketInMessageFactoryTest {
     public void testSerialize() throws Exception {
         PacketInMessageBuilder builder = new PacketInMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setBufferId(256L);
-        builder.setTotalLen(10);
+        builder.setBufferId(Uint32.valueOf(256));
+        builder.setTotalLen(Uint16.TEN);
         builder.setReason(PacketInReason.forValue(0));
-        builder.setTableId(new TableId(1L));
-        byte[] cookie = new byte[] { (byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01 };
-        builder.setCookie(new BigInteger(1, cookie));
+        builder.setTableId(new TableId(Uint32.ONE));
+        builder.setCookie(Uint64.valueOf("FF01040106000701", 16));
         MatchBuilder matchBuilder = new MatchBuilder();
         matchBuilder.setType(OxmMatchType.class);
         final List<MatchEntry> entries = new ArrayList<>();
@@ -76,7 +78,7 @@ public class PacketInMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -85,7 +87,7 @@ public class PacketInMessageFactoryTest {
         entriesBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 4);
+        ipEcnBuilder.setEcn(Uint8.valueOf(4));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entriesBuilder.build());
@@ -104,7 +106,7 @@ public class PacketInMessageFactoryTest {
         Assert.assertEquals("Wrong reason", message.getReason().getIntValue(), serializedBuffer.readUnsignedByte());
         Assert.assertEquals("Wrong tableId", message.getTableId().getValue().intValue(),
                 serializedBuffer.readUnsignedByte());
-        cookie = new byte[Long.BYTES];
+        byte[] cookie = new byte[Long.BYTES];
         serializedBuffer.readBytes(cookie);
         Assert.assertEquals("Wrong cookie", message.getCookie(), Uint64.valueOf(new BigInteger(1, cookie)));
         Assert.assertEquals("Wrong match type", 1, serializedBuffer.readUnsignedShort());
index baf0e8d8c08f4dd86cd5588e70c496c510ed719e..604ba23159641ab2a0f265495a00817e3019e213 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -31,6 +30,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PacketOutInputMessageFactory.
@@ -62,13 +63,13 @@ public class PacketOutInputMessageFactoryTest {
     public void testPacketOutInputMessage() throws Exception {
         PacketOutInputBuilder builder = new PacketOutInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setBufferId(256L);
-        builder.setInPort(new PortNumber(256L));
+        builder.setBufferId(Uint32.valueOf(256));
+        builder.setInPort(new PortNumber(Uint32.valueOf(256)));
         final List<Action> actions = new ArrayList<>();
         ActionBuilder actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
-        pushVlanBuilder.setEthertype(new EtherType(new EtherType(25)));
+        pushVlanBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(25))));
         pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
         actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -106,8 +107,8 @@ public class PacketOutInputMessageFactoryTest {
     public void testPacketOutInputWithNoData() throws Exception {
         PacketOutInputBuilder builder = new PacketOutInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setBufferId(256L);
-        builder.setInPort(new PortNumber(256L));
+        builder.setBufferId(Uint32.valueOf(256));
+        builder.setInPort(new PortNumber(Uint32.valueOf(256)));
         List<Action> actions = new ArrayList<>();
         builder.setAction(actions);
         builder.setData(null);
index 2640fd1a10e5e854ff596cc7ce4be4206ce1d335..d4d79e96e0de0e6bc49b5a281a81bfe1233e65eb 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -26,6 +25,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.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PortModInputMessageFactory.
@@ -60,7 +60,7 @@ public class PortModInputMessageFactoryTest {
     public void testPortModInput() throws Exception {
         PortModInputBuilder builder = new PortModInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setPortNo(new PortNumber(9L));
+        builder.setPortNo(new PortNumber(Uint32.valueOf(9)));
         builder.setHwAddress(new MacAddress("08:00:27:00:B0:EB"));
         builder.setConfig(new PortConfig(true, false, true, false));
         builder.setMask(new PortConfig(false, true, false, true));
index 79ed523ea989be72a737ee029ae118b0127c3f92..30f392edb67dac8c3a0c200b9e93d98a73243f50 100644 (file)
@@ -26,6 +26,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.PortState;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for PortStatusMessageFactory.
@@ -52,7 +53,7 @@ public class PortStatusMessageFactoryTest {
         PortStatusMessageBuilder builder = new PortStatusMessageBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setReason(PortReason.forValue(1));
-        builder.setPortNo(1L);
+        builder.setPortNo(Uint32.ONE);
         builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
         builder.setName("Port name");
         builder.setConfig(new PortConfig(true, false, true, false));
@@ -65,8 +66,8 @@ public class PortStatusMessageFactoryTest {
                 true, false, true, false, true, false));
         builder.setPeerFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true,
                 false, true, false, true, false));
-        builder.setCurrSpeed(1234L);
-        builder.setMaxSpeed(1234L);
+        builder.setCurrSpeed(Uint32.valueOf(1234));
+        builder.setMaxSpeed(Uint32.valueOf(1234));
         PortStatusMessage message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
index 4466563b2d441153bc30a536a29e554342f56b00..f8c61673d900e13fadc197de8f295f3cba3df990 100644 (file)
@@ -59,7 +59,7 @@ public class QueueGetConfigReplyMessageFactoryTest {
     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();
 
index 9511016ebaf502198e6f004122b9801b0a8a3460..b66f310ee04a16ab205626a3fb53a4eed53becb1 100644 (file)
@@ -47,7 +47,7 @@ public class RoleReplyMessageFactoryTest {
         RoleRequestOutputBuilder builder = new RoleRequestOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setRole(ControllerRole.forValue(0));
-        builder.setGenerationId(BigInteger.valueOf(1L));
+        builder.setGenerationId(Uint64.ONE);
         RoleRequestOutput message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
index af431b02f1d98fedeff84de5a7a7113c021f4599..dc35fe14475b5d9042559e491bd224f3c541cb12 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -57,8 +56,7 @@ public class RoleRequestInputMessageFactoryTest {
         RoleRequestInputBuilder builder = new RoleRequestInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setRole(ControllerRole.forValue(2));
-        byte[] generationId = new byte[]{(byte) 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-        builder.setGenerationId(new BigInteger(1, generationId));
+        builder.setGenerationId(Uint64.valueOf("FF01010101010101", 16));
         RoleRequestInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
index 61f615eb2ecaf31d05168bea5155da5f837a87d6..9baef394cd4542add499bbbc83479d2a7db18774 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -22,6 +21,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for SetConfigMessageFactory.
@@ -55,7 +55,7 @@ public class SetConfigMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         SwitchConfigFlag flag = SwitchConfigFlag.FRAGNORMAL;
         builder.setFlags(flag);
-        builder.setMissSendLen(10);
+        builder.setMissSendLen(Uint16.TEN);
         SetConfigInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -75,7 +75,7 @@ public class SetConfigMessageFactoryTest {
         BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
         SwitchConfigFlag flag = SwitchConfigFlag.OFPCFRAGDROP;
         builder.setFlags(flag);
-        builder.setMissSendLen(85);
+        builder.setMissSendLen(Uint16.valueOf(85));
         SetConfigInput message = builder.build();
 
         ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
index 1f198063994c05a52a83c6642cf28ca24d2e9da9..1fa9fb19b7d96b97a47eb3a2dd9ecbdd158598f0 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -23,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.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for TableModInputMessageFactory.
@@ -54,7 +54,7 @@ public class TableModInputMessageFactoryTest {
     public void testTableModInput() throws Exception {
         TableModInputBuilder builder = new TableModInputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
-        builder.setTableId(new TableId(9L));
+        builder.setTableId(new TableId(Uint32.valueOf(9)));
         builder.setConfig(new TableConfig(true));
         TableModInput message = builder.build();
 
index d9bd50bd15a57543d7f804e0c2298de5101c8cc0..68b2e8b4929e1c056451b112abc8464848edbf0a 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.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
@@ -25,6 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for VendorInputMessageFactory.
@@ -51,10 +51,10 @@ public class VendorInputMessageFactoryTest {
         factory.injectSerializerRegistry(registry);
         final ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
-        builder.setVersion((short) EncodeConstants.OF10_VERSION_ID);
-        builder.setXid(12345L);
-        builder.setExperimenter(new ExperimenterId(42L));
-        builder.setExpType(84L);
+        builder.setVersion(EncodeConstants.OF_VERSION_1_0);
+        builder.setXid(Uint32.valueOf(12345));
+        builder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        builder.setExpType(Uint32.valueOf(84));
         builder.setExperimenterDataOfChoice(vendorData);
         ExperimenterInput experimenterInput = builder.build();
 
index e80932d65d796811ff0bbbb622cd66c941281441..cd0cf1b509f7291328fdbca07fbe0d25ec6e32e9 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.protocol.impl.serialization.factories.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -31,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.experimenter._case.MultipartRequestExperimenterBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for MultipartRequestExperimenter.
@@ -61,8 +61,8 @@ public class MultipartRequestExperimenterTest {
         builder.setFlags(new MultipartRequestFlags(false));
         final MultipartRequestExperimenterCaseBuilder caseBuilder = new MultipartRequestExperimenterCaseBuilder();
         MultipartRequestExperimenterBuilder expBuilder = new MultipartRequestExperimenterBuilder();
-        expBuilder.setExperimenter(new ExperimenterId(42L));
-        expBuilder.setExpType(21L);
+        expBuilder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        expBuilder.setExpType(Uint32.valueOf(21));
         expBuilder.setExperimenterDataOfChoice(vendorData);
         caseBuilder.setMultipartRequestExperimenter(expBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
index 6a0bd2e83caa33f92ae7fc454a5f9e6037d18eaf..f5948e38f1b359e76dd3b9855fb76779b34f385a 100644 (file)
@@ -11,7 +11,6 @@ import static org.mockito.ArgumentMatchers.any;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -68,6 +67,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.multipart.request.table.features.TableFeaturesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for MultipartRequestTableFeatures.
@@ -109,19 +111,17 @@ public class MultipartRequestTableFeaturesTest {
         final MultipartRequestTableFeaturesCaseBuilder caseBuilder = new MultipartRequestTableFeaturesCaseBuilder();
         final MultipartRequestTableFeaturesBuilder featuresBuilder = new MultipartRequestTableFeaturesBuilder();
         TableFeaturesBuilder tableFeaturesBuilder = new TableFeaturesBuilder();
-        tableFeaturesBuilder.setTableId((short) 8);
+        tableFeaturesBuilder.setTableId(Uint8.valueOf(8));
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
-        tableFeaturesBuilder.setMetadataMatch(new BigInteger(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}));
-        tableFeaturesBuilder.setMetadataWrite(new BigInteger(
-                new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}));
+        tableFeaturesBuilder.setMetadataMatch(Uint64.valueOf("0001020301040801", 16));
+        tableFeaturesBuilder.setMetadataWrite(Uint64.valueOf("0007010501000301", 16));
         tableFeaturesBuilder.setConfig(new TableConfig(true));
-        tableFeaturesBuilder.setMaxEntries(65L);
+        tableFeaturesBuilder.setMaxEntries(Uint32.valueOf(65));
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLES);
         List<NextTableIds> nextIds = new ArrayList<>();
-        nextIds.add(new NextTableIdsBuilder().setTableId((short) 1).build());
-        nextIds.add(new NextTableIdsBuilder().setTableId((short) 2).build());
+        nextIds.add(new NextTableIdsBuilder().setTableId(Uint8.ONE).build());
+        nextIds.add(new NextTableIdsBuilder().setTableId(Uint8.TWO).build());
         propBuilder.addAugmentation(new NextTableRelatedTableFeaturePropertyBuilder().setNextTableIds(nextIds).build());
         List<TableFeatureProperties> properties = new ArrayList<>();
         properties.add(propBuilder.build());
@@ -164,14 +164,12 @@ public class MultipartRequestTableFeaturesTest {
         List<TableFeatures> tableFeaturesList = new ArrayList<>();
         tableFeaturesList.add(tableFeaturesBuilder.build());
         tableFeaturesBuilder = new TableFeaturesBuilder();
-        tableFeaturesBuilder.setTableId((short) 8);
+        tableFeaturesBuilder.setTableId(Uint8.valueOf(8));
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
-        tableFeaturesBuilder.setMetadataMatch(new BigInteger(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}));
-        tableFeaturesBuilder.setMetadataWrite(new BigInteger(
-                new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}));
+        tableFeaturesBuilder.setMetadataMatch(Uint64.valueOf("0001020301040801", 16));
+        tableFeaturesBuilder.setMetadataWrite(Uint64.valueOf("0007010501000301", 16));
         tableFeaturesBuilder.setConfig(new TableConfig(true));
-        tableFeaturesBuilder.setMaxEntries(67L);
+        tableFeaturesBuilder.setMaxEntries(Uint32.valueOf(67));
         properties = new ArrayList<>();
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITEACTIONS);
@@ -368,25 +366,23 @@ public class MultipartRequestTableFeaturesTest {
         builder.setType(MultipartType.forValue(12));
         builder.setFlags(new MultipartRequestFlags(true));
         TableFeaturesBuilder tableFeaturesBuilder = new TableFeaturesBuilder();
-        tableFeaturesBuilder.setTableId((short) 8);
+        tableFeaturesBuilder.setTableId(Uint8.valueOf(8));
         tableFeaturesBuilder.setName("AAAABBBBCCCCDDDDEEEEFFFFGGGG");
-        tableFeaturesBuilder.setMetadataMatch(new BigInteger(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x01, 0x04, 0x08, 0x01}));
-        tableFeaturesBuilder.setMetadataWrite(new BigInteger(
-                new byte[] {0x00, 0x07, 0x01, 0x05, 0x01, 0x00, 0x03, 0x01}));
+        tableFeaturesBuilder.setMetadataMatch(Uint64.valueOf("0001020301040801", 16));
+        tableFeaturesBuilder.setMetadataWrite(Uint64.valueOf("0007010501000301", 16));
         tableFeaturesBuilder.setConfig(new TableConfig(true));
-        tableFeaturesBuilder.setMaxEntries(65L);
+        tableFeaturesBuilder.setMaxEntries(Uint32.valueOf(65));
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTEXPERIMENTER);
         propBuilder.addAugmentation(new ExperimenterIdTableFeaturePropertyBuilder()
-            .setExperimenter(new ExperimenterId(42L))
+            .setExperimenter(new ExperimenterId(Uint32.valueOf(42)))
             .build());
         List<TableFeatureProperties> properties = new ArrayList<>();
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS);
         propBuilder.addAugmentation(new ExperimenterIdTableFeaturePropertyBuilder()
-            .setExperimenter(new ExperimenterId(43L))
+            .setExperimenter(new ExperimenterId(Uint32.valueOf(43)))
             .build());
         properties.add(propBuilder.build());
         tableFeaturesBuilder.setTableFeatureProperties(properties);
index cdebccecb933fcff695e91c81a52242b0b78244c..6a4ad3c7704e4b9148ab5a7100688d93cbf2a491 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.protocol.impl.serialization.factories.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -30,6 +29,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.aggregate._case.MultipartRequestAggregateBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10StatsRequestAggregate.
@@ -66,23 +68,23 @@ public class OF10StatsRequestAggregateTest {
         MatchV10Builder matchBuilder = new MatchV10Builder();
         matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true,
                 true, true, true, true));
-        matchBuilder.setNwSrcMask((short) 8);
-        matchBuilder.setNwDstMask((short) 16);
-        matchBuilder.setInPort(51);
+        matchBuilder.setNwSrcMask(Uint8.valueOf(8));
+        matchBuilder.setNwDstMask(Uint8.valueOf(16));
+        matchBuilder.setInPort(Uint16.valueOf(51));
         matchBuilder.setDlSrc(new MacAddress("00:01:02:03:04:05"));
         matchBuilder.setDlDst(new MacAddress("05:04:03:02:01:00"));
-        matchBuilder.setDlVlan(52);
-        matchBuilder.setDlVlanPcp((short) 53);
-        matchBuilder.setDlType(54);
-        matchBuilder.setNwTos((short) 55);
-        matchBuilder.setNwProto((short) 56);
+        matchBuilder.setDlVlan(Uint16.valueOf(52));
+        matchBuilder.setDlVlanPcp(Uint8.valueOf(53));
+        matchBuilder.setDlType(Uint16.valueOf(54));
+        matchBuilder.setNwTos(Uint8.valueOf(55));
+        matchBuilder.setNwProto(Uint8.valueOf(56));
         matchBuilder.setNwSrc(new Ipv4Address("10.0.0.1"));
         matchBuilder.setNwDst(new Ipv4Address("10.0.0.2"));
-        matchBuilder.setTpSrc(57);
-        matchBuilder.setTpDst(58);
+        matchBuilder.setTpSrc(Uint16.valueOf(57));
+        matchBuilder.setTpDst(Uint16.valueOf(58));
         aggBuilder.setMatchV10(matchBuilder.build());
-        aggBuilder.setTableId((short) 5);
-        aggBuilder.setOutPort(42L);
+        aggBuilder.setTableId(Uint8.valueOf(5));
+        aggBuilder.setOutPort(Uint32.valueOf(42));
         caseBuilder.setMultipartRequestAggregate(aggBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
         MultipartRequestInput message = builder.build();
index 4163db998034adca4d294d32c1dfe6efab436bc6..952b06fe3c6ac345a8714c8785537839c3e85aea 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.protocol.impl.serialization.factories.multipart;
 
 import io.netty.buffer.ByteBuf;
@@ -31,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestExperimenterCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.experimenter._case.MultipartRequestExperimenterBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OF10StatsRequestExperimenter.
@@ -61,8 +61,8 @@ public class OF10StatsRequestExperimenterTest {
         builder.setFlags(new MultipartRequestFlags(false));
         final MultipartRequestExperimenterCaseBuilder caseBuilder = new MultipartRequestExperimenterCaseBuilder();
         MultipartRequestExperimenterBuilder expBuilder = new MultipartRequestExperimenterBuilder();
-        expBuilder.setExperimenter(new ExperimenterId(42L));
-        expBuilder.setExpType(21L);
+        expBuilder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
+        expBuilder.setExpType(Uint32.valueOf(21));
         expBuilder.setExperimenterDataOfChoice(vendorData);
         caseBuilder.setMultipartRequestExperimenter(expBuilder.build());
         builder.setMultipartRequestBody(caseBuilder.build());
index f51a3817898f6a60d7e55e15b7fb1f8e9ca68c7f..9ec7e5453ad35c1ef0792eb73eae538b95dc329b 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.op._case.ArpOpBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmArpOpSerializer.
@@ -34,7 +35,7 @@ public class OxmArpOpSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareArpOpMatchEntry(1402);
+        MatchEntryBuilder builder = prepareArpOpMatchEntry(Uint16.valueOf(1402));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmArpOpSerializerTest {
         assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareArpOpMatchEntry(int value) {
+    private static MatchEntryBuilder prepareArpOpMatchEntry(Uint16 value) {
         MatchEntryBuilder builder = prepareArpOpHeader(false);
         ArpOpCaseBuilder casebuilder = new ArpOpCaseBuilder();
         ArpOpBuilder valueBuilder = new ArpOpBuilder();
index 3c2bf711da9f13cb2211a1648611aaa08ad95f70..cfbb3afef2e9dd9109e2b6159b53ef9376d80ff5 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.type._case.EthTypeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmEthTypeSerializer.
@@ -35,7 +36,7 @@ public class OxmEthTypeSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareEthTypeMatchEntry(65535);
+        MatchEntryBuilder builder = prepareEthTypeMatchEntry(Uint16.MAX_VALUE);
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -83,7 +84,7 @@ public class OxmEthTypeSerializerTest {
         assertEquals("Wrong value length", Short.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareEthTypeMatchEntry(int type) {
+    private static MatchEntryBuilder prepareEthTypeMatchEntry(Uint16 type) {
         MatchEntryBuilder builder = prepareEthTypeHeader(false);
         EthTypeCaseBuilder casebuilder = new EthTypeCaseBuilder();
         EthTypeBuilder valueBuilder = new EthTypeBuilder();
index 27918975d083d041ab88aa86e7a32ff2e96ee3d4..1d69813d67385894ee5dcb24c2080c6d4584452a 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIcmpv4CodeSerializer.
@@ -34,7 +35,7 @@ public class OxmIcmpv4CodeSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareIcmpv4CodeMatchEntry((short) 200);
+        MatchEntryBuilder builder = prepareIcmpv4CodeMatchEntry(Uint8.valueOf(200));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmIcmpv4CodeSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareIcmpv4CodeMatchEntry(short value) {
+    private static MatchEntryBuilder prepareIcmpv4CodeMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareIcmpv4CodeHeader(false);
         Icmpv4CodeCaseBuilder casebuilder = new Icmpv4CodeCaseBuilder();
         Icmpv4CodeBuilder valueBuilder = new Icmpv4CodeBuilder();
index 769613dffec0dc02211a8166fe54079179e4f609..39dc1e3d0162d74588392806cacff5e1c8f7ca3b 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIcmpv4TypeSerializer.
@@ -34,7 +35,7 @@ public class OxmIcmpv4TypeSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareIcmpv4TypeMatchEntry((short) 128);
+        MatchEntryBuilder builder = prepareIcmpv4TypeMatchEntry(Uint8.valueOf(128));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmIcmpv4TypeSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareIcmpv4TypeMatchEntry(short value) {
+    private static MatchEntryBuilder prepareIcmpv4TypeMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareIcmpv4TypeHeader(false);
         Icmpv4TypeCaseBuilder casebuilder = new Icmpv4TypeCaseBuilder();
         Icmpv4TypeBuilder valueBuilder = new Icmpv4TypeBuilder();
index 17f7fb2f4ef8ccc035419ae39832eeaeff078164..03bfebcc326368c999f1e508a04173e54d02b0f7 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIcmpv6CodeSerializer.
@@ -34,7 +35,7 @@ public class OxmIcmpv6CodeSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareIcmpv6CodeMatchEntry((short) 101);
+        MatchEntryBuilder builder = prepareIcmpv6CodeMatchEntry(Uint8.valueOf(101));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmIcmpv6CodeSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareIcmpv6CodeMatchEntry(short value) {
+    private static MatchEntryBuilder prepareIcmpv6CodeMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareIcmpv6CodeHeader(false);
         Icmpv6CodeCaseBuilder casebuilder = new Icmpv6CodeCaseBuilder();
         Icmpv6CodeBuilder valueBuilder = new Icmpv6CodeBuilder();
index 0d25c9e8d43cac2a5b05d6627d823ef7b026cd04..c18a723efb7f0b851110349d2add60d01b08bdb3 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.type._case.Icmpv6TypeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIcmpv6TypeSerializer.
@@ -34,7 +35,7 @@ public class OxmIcmpv6TypeSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareIcmpv6TypeMatchEntry((short) 123);
+        MatchEntryBuilder builder = prepareIcmpv6TypeMatchEntry(Uint8.valueOf(123));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmIcmpv6TypeSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareIcmpv6TypeMatchEntry(short value) {
+    private static MatchEntryBuilder prepareIcmpv6TypeMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareIcmpv6TypeHeader(false);
         Icmpv6TypeCaseBuilder casebuilder = new Icmpv6TypeCaseBuilder();
         Icmpv6TypeBuilder valueBuilder = new Icmpv6TypeBuilder();
index c82b3049901088842ecc724b559127e4e307c686..7117446dad4ed001cb8b0238ddca81320f9248ad 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIpDscpSerializer.
@@ -35,7 +36,7 @@ public class OxmIpDscpSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareIpDscpMatchEntry((short) 58);
+        MatchEntryBuilder builder = prepareIpDscpMatchEntry(Uint8.valueOf(58));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -83,7 +84,7 @@ public class OxmIpDscpSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareIpDscpMatchEntry(short value) {
+    private static MatchEntryBuilder prepareIpDscpMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareIpDscpHeader(false);
         IpDscpCaseBuilder casebuilder = new IpDscpCaseBuilder();
         IpDscpBuilder dscpBuilder = new IpDscpBuilder();
index c503a321ad3edcc34eff6ab848ae80cd3da8f05e..5efebc51bd94dac52320458d84453066adc0872c 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.proto._case.IpProtoBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmIpProtoSerializer.
@@ -34,7 +35,7 @@ public class OxmIpProtoSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareMatchEntry((short) 123);
+        MatchEntryBuilder builder = prepareMatchEntry(Uint8.valueOf(123));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmIpProtoSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareMatchEntry(short value) {
+    private static MatchEntryBuilder prepareMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareHeader(false);
         IpProtoCaseBuilder casebuilder = new IpProtoCaseBuilder();
         IpProtoBuilder protoBuilder = new IpProtoBuilder();
index a9c78196bac7af057c4b267b55788203d4a4b475..ed71ae2388f8dafcc4c3a6c067226d9db4ed7e24 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.label._case.MplsLabelBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OxmMplsLabelSerializer.
@@ -34,7 +35,7 @@ public class OxmMplsLabelSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareMplsLabelMatchEntry(168535);
+        MatchEntryBuilder builder = prepareMplsLabelMatchEntry(Uint32.valueOf(168535));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmMplsLabelSerializerTest {
         assertEquals("Wrong value length", Integer.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareMplsLabelMatchEntry(long label) {
+    private static MatchEntryBuilder prepareMplsLabelMatchEntry(Uint32 label) {
         MatchEntryBuilder builder = prepareMplsLabelHeader(false);
         MplsLabelCaseBuilder casebuilder = new MplsLabelCaseBuilder();
         MplsLabelBuilder valueBuilder = new MplsLabelBuilder();
index 2cf22df4fb133c3410fdd9ae33b2b08df8a9710d..ddbcc845c872cab58080298c66e7b748d72fa939 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.tc._case.MplsTcBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmMplsTcSerializer.
@@ -34,7 +35,7 @@ public class OxmMplsTcSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareMplsTcMatchEntry((short) 16);
+        MatchEntryBuilder builder = prepareMplsTcMatchEntry(Uint8.valueOf(16));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmMplsTcSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareMplsTcMatchEntry(short value) {
+    private static MatchEntryBuilder prepareMplsTcMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareMplsTcHeader(false);
         MplsTcCaseBuilder casebuilder = new MplsTcCaseBuilder();
         MplsTcBuilder valueBuilder = new MplsTcBuilder();
index 1c9faac4fdb70975f298df632f21b049a7c5f59b..a968d1c418bbdf7048f848878ac7153b7d4cfa09 100644 (file)
@@ -21,6 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PacketTypeCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PacketTypeCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.packet.type._case.PacketTypeBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class OxmPacketTypeSerializerTest {
     private ByteBuf buffer;
@@ -35,7 +36,7 @@ public class OxmPacketTypeSerializerTest {
     @Test
     public void serializeTest() {
         final long packetType = 0x1894f;
-        MatchEntry matchEntry = createMatchEntry(packetType);
+        MatchEntry matchEntry = createMatchEntry(Uint32.valueOf(packetType));
 
         serializer.serialize(matchEntry, buffer);
 
@@ -47,7 +48,7 @@ public class OxmPacketTypeSerializerTest {
         assertEquals(packetType, buffer.readUnsignedInt());
     }
 
-    private static MatchEntry createMatchEntry(long packetType) {
+    private static MatchEntry createMatchEntry(Uint32 packetType) {
         PacketTypeCase packetTypeCase = new PacketTypeCaseBuilder()
                 .setPacketType(new PacketTypeBuilder().setPacketType(packetType).build())
                 .build();
index bce8c3f77ff7d31c08a88bff99fda40dbcd32cb8..e2427d5120a76f73a82272a6afd934221ebb18d0 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbI
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsidBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Unit tests for OxmPbbIsidSerializer.
@@ -117,14 +118,14 @@ public class OxmPbbIsidSerializerTest {
         assertEquals("Wrong value length", EncodeConstants.SIZE_OF_3_BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder preparePbbIsidMatchEntry(boolean hasMask, long value) {
+    private static MatchEntryBuilder preparePbbIsidMatchEntry(boolean hasMask, int value) {
         final MatchEntryBuilder builder = preparePbbIsidHeader(hasMask);
         PbbIsidCaseBuilder casebuilder = new PbbIsidCaseBuilder();
         PbbIsidBuilder valueBuilder = new PbbIsidBuilder();
         if (hasMask) {
             valueBuilder.setMask(new byte[]{0, 15, 10});
         }
-        valueBuilder.setIsid(value);
+        valueBuilder.setIsid(Uint32.valueOf(value));
         casebuilder.setPbbIsid(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 374e729489998289627ba6e027927eb7f6801e2e..81b14024efbd2239cb3473462de254abf0f23122 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Sctp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.dst._case.SctpDstBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmSctpDstSerializer.
@@ -87,7 +88,7 @@ public class OxmSctpDstSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         SctpDstCaseBuilder casebuilder = new SctpDstCaseBuilder();
         SctpDstBuilder valueBuilder = new SctpDstBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setSctpDst(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 06f036e99d1296d4ce39898356224310b394fecc..7d63e0f99141dcf8d720532eaa4d5014dd01f8fe 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Sctp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.src._case.SctpSrcBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmSctpSrcSerializer.
@@ -87,7 +88,7 @@ public class OxmSctpSrcSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         SctpSrcCaseBuilder casebuilder = new SctpSrcCaseBuilder();
         SctpSrcBuilder valueBuilder = new SctpSrcBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setSctpSrc(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index ff17a6b9e43ee19df0de66ba7e08156a5ed72225..627782bc38084e0714e8dd763debf683521a955a 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpD
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.dst._case.TcpDstBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmTcpDstSerializer.
@@ -87,7 +88,7 @@ public class OxmTcpDstSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         TcpDstCaseBuilder casebuilder = new TcpDstCaseBuilder();
         TcpDstBuilder valueBuilder = new TcpDstBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setTcpDst(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 0789b416b35443866282506282c5599b03046450..f7f4c5471022c223d23ec6ab6b8a3cbffd463865 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpS
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.src._case.TcpSrcBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmTcpSrcSerializer.
@@ -87,7 +88,7 @@ public class OxmTcpSrcSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         TcpSrcCaseBuilder casebuilder = new TcpSrcCaseBuilder();
         TcpSrcBuilder valueBuilder = new TcpSrcBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setTcpSrc(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 76356edf191af3b3fa92d3a63e012ccf77372f2d..1d91fd50b55b1ba7e3bea12e7556bd5c99573aff 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpD
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.dst._case.UdpDstBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmUdpDstSerializer.
@@ -87,7 +88,7 @@ public class OxmUdpDstSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         UdpDstCaseBuilder casebuilder = new UdpDstCaseBuilder();
         UdpDstBuilder valueBuilder = new UdpDstBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setUdpDst(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 256271ce6f1802c9ec36e3ab1d43fc2c0f7f35c8..39fbf7029a0166c9c46d19072d5d35fc9a8d1e64 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpS
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.src._case.UdpSrcBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmUdpSrcSerializer.
@@ -87,7 +88,7 @@ public class OxmUdpSrcSerializerTest {
         MatchEntryBuilder builder = prepareHeader(false);
         UdpSrcCaseBuilder casebuilder = new UdpSrcCaseBuilder();
         UdpSrcBuilder valueBuilder = new UdpSrcBuilder();
-        valueBuilder.setPort(new PortNumber(value));
+        valueBuilder.setPort(new PortNumber(Uint16.valueOf(value)));
         casebuilder.setUdpSrc(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
         return builder;
index 211427c27a9cb3e0c349cba706150115a0452165..2140bd8aecebfc585101b3bfa68397858d095c40 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Vlan
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.pcp._case.VlanPcpBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OxmVlanPcpSerializer.
@@ -34,7 +35,7 @@ public class OxmVlanPcpSerializerTest {
      */
     @Test
     public void testSerialize() {
-        MatchEntryBuilder builder = prepareVlanPcpMatchEntry((short) 42);
+        MatchEntryBuilder builder = prepareVlanPcpMatchEntry(Uint8.valueOf(42));
 
         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
         serializer.serialize(builder.build(), buffer);
@@ -82,7 +83,7 @@ public class OxmVlanPcpSerializerTest {
         assertEquals("Wrong value length", Byte.BYTES, serializer.getValueLength());
     }
 
-    private static MatchEntryBuilder prepareVlanPcpMatchEntry(short value) {
+    private static MatchEntryBuilder prepareVlanPcpMatchEntry(Uint8 value) {
         MatchEntryBuilder builder = prepareVlanPcpHeader(false);
         VlanPcpCaseBuilder casebuilder = new VlanPcpCaseBuilder();
         VlanPcpBuilder valueBuilder = new VlanPcpBuilder();
index a17f36e134d8673fe8bded72122489460f4b6996..53aabf299852077aae33e2dfbd3c037795c883f5 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Vlan
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVidBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Unit tests for OxmVlanVidSerializer.
@@ -122,7 +123,7 @@ public class OxmVlanVidSerializerTest {
         if (hasMask) {
             valueBuilder.setMask(new byte[]{15, 15});
         }
-        valueBuilder.setVlanVid(500);
+        valueBuilder.setVlanVid(Uint16.valueOf(500));
         valueBuilder.setCfiBit(cfiBit);
         casebuilder.setVlanVid(valueBuilder.build());
         builder.setMatchEntryValue(casebuilder.build());
index 60bc7e2949918d835628b4a6e0607ff17d7bf0bd..c0f616dcecdc47825d68651bf9b4a6a56ef97716 100644 (file)
@@ -47,6 +47,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 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.PortNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10ActionsSerializer.
@@ -74,8 +77,8 @@ public class OF10ActionsSerializerTest {
         final List<Action> actions = new ArrayList<>();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(32);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(32));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -83,14 +86,14 @@ public class OF10ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         SetVlanVidCaseBuilder vlanVidCaseBuilder = new SetVlanVidCaseBuilder();
         SetVlanVidActionBuilder vlanVidBuilder = new SetVlanVidActionBuilder();
-        vlanVidBuilder.setVlanVid(15);
+        vlanVidBuilder.setVlanVid(Uint16.valueOf(15));
         vlanVidCaseBuilder.setSetVlanVidAction(vlanVidBuilder.build());
         actionBuilder.setActionChoice(vlanVidCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetVlanPcpCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpCaseBuilder();
         SetVlanPcpActionBuilder vlanPcpBuilder = new SetVlanPcpActionBuilder();
-        vlanPcpBuilder.setVlanPcp((short) 16);
+        vlanPcpBuilder.setVlanPcp(Uint8.valueOf(16));
         vlanPcpCaseBuilder.setSetVlanPcpAction(vlanPcpBuilder.build());
         actionBuilder.setActionChoice(vlanPcpCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -128,29 +131,29 @@ public class OF10ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         SetNwTosCaseBuilder tosCaseBuilder = new SetNwTosCaseBuilder();
         SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
-        tosBuilder.setNwTos((short) 204);
+        tosBuilder.setNwTos(Uint8.valueOf(204));
         tosCaseBuilder.setSetNwTosAction(tosBuilder.build());
         actionBuilder.setActionChoice(tosCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetTpSrcCaseBuilder tpSrcCaseBuilder = new SetTpSrcCaseBuilder();
         SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
-        tpSrcBuilder.setPort(new PortNumber(6653L));
+        tpSrcBuilder.setPort(new PortNumber(Uint32.valueOf(6653)));
         tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
         actionBuilder.setActionChoice(tpSrcCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetTpDstCaseBuilder tpDstCaseBuilder = new SetTpDstCaseBuilder();
         SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();
-        tpDstBuilder.setPort(new PortNumber(6633L));
+        tpDstBuilder.setPort(new PortNumber(Uint32.valueOf(6633)));
         tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());
         actionBuilder.setActionChoice(tpDstCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         EnqueueCaseBuilder enqueueCaseBuilder = new EnqueueCaseBuilder();
         EnqueueActionBuilder enqueueBuilder = new EnqueueActionBuilder();
-        enqueueBuilder.setPort(new PortNumber(6613L));
-        enqueueBuilder.setQueueId(new QueueId(400L));
+        enqueueBuilder.setPort(new PortNumber(Uint32.valueOf(6613)));
+        enqueueBuilder.setQueueId(new QueueId(Uint32.valueOf(400)));
         enqueueCaseBuilder.setEnqueueAction(enqueueBuilder.build());
         actionBuilder.setActionChoice(enqueueCaseBuilder.build());
         actions.add(actionBuilder.build());
index 22d8171319fb66af47fcb468c9f49f267b1f57dc..f4d84d726c7645d9ee1c39e6e8ca8621bbab7a81 100644 (file)
@@ -24,6 +24,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF10MatchSerializer.
@@ -55,20 +57,20 @@ public class OF10MatchSerializerTest {
         MatchV10Builder builder = new MatchV10Builder();
         builder.setWildcards(new FlowWildcardsV10(false, false, true, false,
                 false, true, false, true, true, true));
-        builder.setNwSrcMask((short) 24);
-        builder.setNwDstMask((short) 16);
-        builder.setInPort(6653);
+        builder.setNwSrcMask(Uint8.valueOf(24));
+        builder.setNwDstMask(Uint8.valueOf(16));
+        builder.setInPort(Uint16.valueOf(6653));
         builder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         builder.setDlDst(new MacAddress("02:02:02:02:02:02"));
-        builder.setDlVlan(128);
-        builder.setDlVlanPcp((short) 2);
-        builder.setDlType(15);
-        builder.setNwTos((short) 14);
-        builder.setNwProto((short) 85);
+        builder.setDlVlan(Uint16.valueOf(128));
+        builder.setDlVlanPcp(Uint8.TWO);
+        builder.setDlType(Uint16.valueOf(15));
+        builder.setNwTos(Uint8.valueOf(14));
+        builder.setNwProto(Uint8.valueOf(85));
         builder.setNwSrc(new Ipv4Address("1.1.1.2"));
         builder.setNwDst(new Ipv4Address("32.16.8.1"));
-        builder.setTpSrc(2048);
-        builder.setTpDst(4096);
+        builder.setTpSrc(Uint16.valueOf(2048));
+        builder.setTpDst(Uint16.valueOf(4096));
         MatchV10 match = builder.build();
         matchSerializer.serialize(match, out);
 
@@ -102,20 +104,20 @@ public class OF10MatchSerializerTest {
         MatchV10Builder builder = new MatchV10Builder();
         builder.setWildcards(new FlowWildcardsV10(true, true, true, true,
                 true, true, true, true, true, true));
-        builder.setNwSrcMask((short) 0);
-        builder.setNwDstMask((short) 0);
-        builder.setInPort(6653);
+        builder.setNwSrcMask(Uint8.ZERO);
+        builder.setNwDstMask(Uint8.ZERO);
+        builder.setInPort(Uint16.valueOf(6653));
         builder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
         builder.setDlDst(new MacAddress("02:02:02:02:02:02"));
-        builder.setDlVlan(128);
-        builder.setDlVlanPcp((short) 2);
-        builder.setDlType(15);
-        builder.setNwTos((short) 14);
-        builder.setNwProto((short) 85);
+        builder.setDlVlan(Uint16.valueOf(128));
+        builder.setDlVlanPcp(Uint8.TWO);
+        builder.setDlType(Uint16.valueOf(15));
+        builder.setNwTos(Uint8.valueOf(14));
+        builder.setNwProto(Uint8.valueOf(85));
         builder.setNwSrc(new Ipv4Address("1.1.1.2"));
         builder.setNwDst(new Ipv4Address("32.16.8.1"));
-        builder.setTpSrc(2048);
-        builder.setTpDst(4096);
+        builder.setTpSrc(Uint16.valueOf(2048));
+        builder.setTpDst(Uint16.valueOf(4096));
         MatchV10 match = builder.build();
         matchSerializer.serialize(match, out);
 
index e54beea9d5a06699d16f7b3463603ba77f47eb5b..d689eff3cfa7eee4ca7eb73e7b0ce60979f40d64 100644 (file)
@@ -53,6 +53,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF13ActionsSerializer.
@@ -79,8 +82,8 @@ public class OF13ActionsSerializerTest {
     public void test() {
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(52);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(52));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -95,7 +98,7 @@ public class OF13ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();
         SetMplsTtlActionBuilder setMplsTtlBuilder = new SetMplsTtlActionBuilder();
-        setMplsTtlBuilder.setMplsTtl((short) 4);
+        setMplsTtlBuilder.setMplsTtl(Uint8.valueOf(4));
         setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlBuilder.build());
         actionBuilder.setActionChoice(setMplsTtlCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -105,7 +108,7 @@ public class OF13ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
-        pushVlanBuilder.setEthertype(new EtherType(new EtherType(16)));
+        pushVlanBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(16))));
         pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
         actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -115,35 +118,35 @@ public class OF13ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         PushMplsCaseBuilder pushMplsCaseBuilder = new PushMplsCaseBuilder();
         PushMplsActionBuilder pushMplsBuilder = new PushMplsActionBuilder();
-        pushMplsBuilder.setEthertype(new EtherType(new EtherType(17)));
+        pushMplsBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(17))));
         pushMplsCaseBuilder.setPushMplsAction(pushMplsBuilder.build());
         actionBuilder.setActionChoice(pushMplsCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
         PopMplsActionBuilder popMplsBuilder = new PopMplsActionBuilder();
-        popMplsBuilder.setEthertype(new EtherType(new EtherType(18)));
+        popMplsBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(18))));
         popMplsCaseBuilder.setPopMplsAction(popMplsBuilder.build());
         actionBuilder.setActionChoice(popMplsCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetQueueCaseBuilder setQueueCaseBuilder = new SetQueueCaseBuilder();
         SetQueueActionBuilder setQueueBuilder = new SetQueueActionBuilder();
-        setQueueBuilder.setQueueId(1234L);
+        setQueueBuilder.setQueueId(Uint32.valueOf(1234));
         setQueueCaseBuilder.setSetQueueAction(setQueueBuilder.build());
         actionBuilder.setActionChoice(setQueueCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();
         GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
-        groupActionBuilder.setGroupId(555L);
+        groupActionBuilder.setGroupId(Uint32.valueOf(555));
         groupCaseBuilder.setGroupAction(groupActionBuilder.build());
         actionBuilder.setActionChoice(groupCaseBuilder.build());
         actions.add(actionBuilder.build());
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder nwTtlCaseBuilder = new SetNwTtlCaseBuilder();
         SetNwTtlActionBuilder nwTtlBuilder = new SetNwTtlActionBuilder();
-        nwTtlBuilder.setNwTtl((short) 8);
+        nwTtlBuilder.setNwTtl(Uint8.valueOf(8));
         nwTtlCaseBuilder.setSetNwTtlAction(nwTtlBuilder.build());
         actionBuilder.setActionChoice(nwTtlCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -157,7 +160,7 @@ public class OF13ActionsSerializerTest {
         matchBuilder.setHasMask(false);
         InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
         InPortBuilder inPortBuilder = new InPortBuilder();
-        inPortBuilder.setPortNumber(new PortNumber(1L));
+        inPortBuilder.setPortNumber(new PortNumber(Uint32.ONE));
         inPortCaseBuilder.setInPort(inPortBuilder.build());
         matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
         List<MatchEntry> entries = new ArrayList<>();
@@ -171,7 +174,7 @@ public class OF13ActionsSerializerTest {
         actionBuilder = new ActionBuilder();
         PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
         PushPbbActionBuilder pushPbbBuilder = new PushPbbActionBuilder();
-        pushPbbBuilder.setEthertype(new EtherType(new EtherType(19)));
+        pushPbbBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(19))));
         pushPbbCaseBuilder.setPushPbbAction(pushPbbBuilder.build());
         actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -253,8 +256,8 @@ public class OF13ActionsSerializerTest {
     public void testHeaders() {
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(42L));
-        outputBuilder.setMaxLength(52);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(42)));
+        outputBuilder.setMaxLength(Uint16.valueOf(52));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -267,7 +270,7 @@ public class OF13ActionsSerializerTest {
         matchBuilder.setHasMask(false);
         InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
         InPortBuilder inPortBuilder = new InPortBuilder();
-        inPortBuilder.setPortNumber(new PortNumber(1L));
+        inPortBuilder.setPortNumber(new PortNumber(Uint32.ONE));
         inPortCaseBuilder.setInPort(inPortBuilder.build());
         matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
         List<MatchEntry> entries = new ArrayList<>();
index 40d708a43136f7f24ab19d49f6d827b6477e7f66..d387e61143233d714153efad5dcb61795375187c 100644 (file)
@@ -42,6 +42,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF13InstructionsSerializer.
@@ -71,7 +74,7 @@ public class OF13InstructionsSerializerTest {
         InstructionBuilder builder = new InstructionBuilder();
         GotoTableCaseBuilder gotoCaseBuilder = new GotoTableCaseBuilder();
         GotoTableBuilder instructionBuilder = new GotoTableBuilder();
-        instructionBuilder.setTableId((short) 5);
+        instructionBuilder.setTableId(Uint8.valueOf(5));
         gotoCaseBuilder.setGotoTable(instructionBuilder.build());
         builder.setInstructionChoice(gotoCaseBuilder.build());
         instructions.add(builder.build());
@@ -92,7 +95,7 @@ public class OF13InstructionsSerializerTest {
         builder = new InstructionBuilder();
         MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
         MeterBuilder meterBuilder = new MeterBuilder();
-        meterBuilder.setMeterId(42L);
+        meterBuilder.setMeterId(Uint32.valueOf(42));
         meterCaseBuilder.setMeter(meterBuilder.build());
         builder.setInstructionChoice(meterCaseBuilder.build());
         instructions.add(builder.build());
@@ -102,8 +105,8 @@ public class OF13InstructionsSerializerTest {
         final WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
         OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
         OutputActionBuilder outputBuilder = new OutputActionBuilder();
-        outputBuilder.setPort(new PortNumber(45L));
-        outputBuilder.setMaxLength(55);
+        outputBuilder.setPort(new PortNumber(Uint32.valueOf(45)));
+        outputBuilder.setMaxLength(Uint16.valueOf(55));
         caseBuilder.setOutputAction(outputBuilder.build());
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(caseBuilder.build());
@@ -112,7 +115,7 @@ public class OF13InstructionsSerializerTest {
         actionBuilder = new ActionBuilder();
         SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
         SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
-        ttlActionBuilder.setNwTtl((short) 64);
+        ttlActionBuilder.setNwTtl(Uint8.valueOf(64));
         ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
         actionBuilder.setActionChoice(ttlCaseBuilder.build());
         actions.add(actionBuilder.build());
@@ -128,7 +131,7 @@ public class OF13InstructionsSerializerTest {
         actionBuilder = new ActionBuilder();
         PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
         PushVlanActionBuilder vlanBuilder = new PushVlanActionBuilder();
-        vlanBuilder.setEthertype(new EtherType(new EtherType(14)));
+        vlanBuilder.setEthertype(new EtherType(new EtherType(Uint16.valueOf(14))));
         vlanCaseBuilder.setPushVlanAction(vlanBuilder.build());
         actionBuilder.setActionChoice(vlanCaseBuilder.build());
         actions.add(actionBuilder.build());
index 5aa5984c2524cc3558f8e7c88c805e948174ce0a..81199f8c9d79644f246bf9eb95fbbceca1350e65 100644 (file)
@@ -156,6 +156,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVidBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Unit tests for OF13MatchSerializer02.
@@ -209,7 +212,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
         InPortBuilder inPortBuilder = new InPortBuilder();
-        inPortBuilder.setPortNumber(new PortNumber(42L));
+        inPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(42)));
         inPortCaseBuilder.setInPort(inPortBuilder.build());
         entryBuilder.setMatchEntryValue(inPortCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -219,7 +222,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
         InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
-        inPhyPortBuilder.setPortNumber(new PortNumber(43L));
+        inPhyPortBuilder.setPortNumber(new PortNumber(Uint32.valueOf(43)));
         inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
         entryBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -262,7 +265,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         EthTypeCaseBuilder ethTypeCaseBuilder = new EthTypeCaseBuilder();
         EthTypeBuilder ethTypeBuilder = new EthTypeBuilder();
-        ethTypeBuilder.setEthType(new EtherType(46));
+        ethTypeBuilder.setEthType(new EtherType(Uint16.valueOf(46)));
         ethTypeCaseBuilder.setEthType(ethTypeBuilder.build());
         entryBuilder.setMatchEntryValue(ethTypeCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -272,7 +275,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(true);
         final VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
         VlanVidBuilder vlanVidBuilder = new VlanVidBuilder();
-        vlanVidBuilder.setVlanVid(45);
+        vlanVidBuilder.setVlanVid(Uint16.valueOf(45));
         vlanVidBuilder.setCfiBit(true);
         vlanVidBuilder.setMask(new byte[]{0,9});
         vlanVidCaseBuilder.setVlanVid(vlanVidBuilder.build());
@@ -284,7 +287,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         VlanPcpCaseBuilder vlanPcpCaseBuilder = new VlanPcpCaseBuilder();
         VlanPcpBuilder vlanPcpBuilder = new VlanPcpBuilder();
-        vlanPcpBuilder.setVlanPcp((short) 14);
+        vlanPcpBuilder.setVlanPcp(Uint8.valueOf(14));
         vlanPcpCaseBuilder.setVlanPcp(vlanPcpBuilder.build());
         entryBuilder.setMatchEntryValue(vlanPcpCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -294,7 +297,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         IpDscpCaseBuilder ipDscpCaseBuilder = new IpDscpCaseBuilder();
         IpDscpBuilder ipDscpBuilder = new IpDscpBuilder();
-        ipDscpBuilder.setDscp(new Dscp((short) 48));
+        ipDscpBuilder.setDscp(new Dscp(Uint8.valueOf(48)));
         ipDscpCaseBuilder.setIpDscp(ipDscpBuilder.build());
         entryBuilder.setMatchEntryValue(ipDscpCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -304,7 +307,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
         IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
-        ipEcnBuilder.setEcn((short) 49);
+        ipEcnBuilder.setEcn(Uint8.valueOf(49));
         ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
         entryBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -314,7 +317,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         IpProtoCaseBuilder ipProtoCaseBuilder = new IpProtoCaseBuilder();
         IpProtoBuilder ipProtoBuilder = new IpProtoBuilder();
-        ipProtoBuilder.setProtocolNumber((short) 50);
+        ipProtoBuilder.setProtocolNumber(Uint8.valueOf(50));
         ipProtoCaseBuilder.setIpProto(ipProtoBuilder.build());
         entryBuilder.setMatchEntryValue(ipProtoCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -347,7 +350,7 @@ public class OF13MatchSerializer02Test {
         TcpSrcCaseBuilder tcpSrcCaseBuilder = new TcpSrcCaseBuilder();
         TcpSrcBuilder tcpSrcBuilder = new TcpSrcBuilder();
         tcpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6653));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6653)));
         tcpSrcCaseBuilder.setTcpSrc(tcpSrcBuilder.build());
         entryBuilder.setMatchEntryValue(tcpSrcCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -358,7 +361,7 @@ public class OF13MatchSerializer02Test {
         TcpDstCaseBuilder tcpDstCaseBuilder = new TcpDstCaseBuilder();
         TcpDstBuilder tcpDstBuilder = new TcpDstBuilder();
         tcpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6654));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6654)));
         tcpDstCaseBuilder.setTcpDst(tcpDstBuilder.build());
         entryBuilder.setMatchEntryValue(tcpDstCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -369,7 +372,7 @@ public class OF13MatchSerializer02Test {
         UdpSrcCaseBuilder udpSrcCaseBuilder = new UdpSrcCaseBuilder();
         UdpSrcBuilder udpSrcBuilder = new UdpSrcBuilder();
         udpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6655));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6655)));
         udpSrcCaseBuilder.setUdpSrc(udpSrcBuilder.build());
         entryBuilder.setMatchEntryValue(udpSrcCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -380,7 +383,7 @@ public class OF13MatchSerializer02Test {
         UdpDstCaseBuilder udpDstCaseBuilder = new UdpDstCaseBuilder();
         UdpDstBuilder udpDstBuilder = new UdpDstBuilder();
         udpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6656));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6656)));
         udpDstCaseBuilder.setUdpDst(udpDstBuilder.build());
         entryBuilder.setMatchEntryValue(udpDstCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -391,7 +394,7 @@ public class OF13MatchSerializer02Test {
         SctpSrcCaseBuilder sctpSrcCaseBuilder = new SctpSrcCaseBuilder();
         SctpSrcBuilder sctpSrcBuilder = new SctpSrcBuilder();
         sctpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6657));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6657)));
         sctpSrcCaseBuilder.setSctpSrc(sctpSrcBuilder.build());
         entryBuilder.setMatchEntryValue(sctpSrcCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -402,7 +405,7 @@ public class OF13MatchSerializer02Test {
         SctpDstCaseBuilder sctpDstCaseBuilder = new SctpDstCaseBuilder();
         SctpDstBuilder sctpDstBuilder = new SctpDstBuilder();
         sctpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
-                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(6658));
+                .xml.ns.yang.ietf.inet.types.rev130715.PortNumber(Uint16.valueOf(6658)));
         sctpDstCaseBuilder.setSctpDst(sctpDstBuilder.build());
         entryBuilder.setMatchEntryValue(sctpDstCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -412,7 +415,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         Icmpv4TypeCaseBuilder icmpv4TypeCaseBuilder = new Icmpv4TypeCaseBuilder();
         Icmpv4TypeBuilder icmpv4TypeBuilder = new Icmpv4TypeBuilder();
-        icmpv4TypeBuilder.setIcmpv4Type((short) 51);
+        icmpv4TypeBuilder.setIcmpv4Type(Uint8.valueOf(51));
         icmpv4TypeCaseBuilder.setIcmpv4Type(icmpv4TypeBuilder.build());
         entryBuilder.setMatchEntryValue(icmpv4TypeCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -422,7 +425,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         Icmpv4CodeCaseBuilder icmpv4CodeCaseBuilder = new Icmpv4CodeCaseBuilder();
         Icmpv4CodeBuilder icmpv4CodeBuilder = new Icmpv4CodeBuilder();
-        icmpv4CodeBuilder.setIcmpv4Code((short) 52);
+        icmpv4CodeBuilder.setIcmpv4Code(Uint8.valueOf(52));
         icmpv4CodeCaseBuilder.setIcmpv4Code(icmpv4CodeBuilder.build());
         entryBuilder.setMatchEntryValue(icmpv4CodeCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -432,7 +435,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         ArpOpCaseBuilder arpOpCaseBuilder = new ArpOpCaseBuilder();
         ArpOpBuilder arpOpBuilder = new ArpOpBuilder();
-        arpOpBuilder.setOpCode(53);
+        arpOpBuilder.setOpCode(Uint16.valueOf(53));
         arpOpCaseBuilder.setArpOp(arpOpBuilder.build());
         entryBuilder.setMatchEntryValue(arpOpCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -508,7 +511,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         Ipv6FlabelCaseBuilder ipv6FlabelCaseBuilder = new Ipv6FlabelCaseBuilder();
         Ipv6FlabelBuilder ipv6FlabelBuilder = new Ipv6FlabelBuilder();
-        ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(58L));
+        ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(Uint32.valueOf(58)));
         ipv6FlabelCaseBuilder.setIpv6Flabel(ipv6FlabelBuilder.build());
         entryBuilder.setMatchEntryValue(ipv6FlabelCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -518,7 +521,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         Icmpv6TypeCaseBuilder icmpv6TypeCaseBuilder = new Icmpv6TypeCaseBuilder();
         Icmpv6TypeBuilder icmpv6TypeBuilder = new Icmpv6TypeBuilder();
-        icmpv6TypeBuilder.setIcmpv6Type((short) 59);
+        icmpv6TypeBuilder.setIcmpv6Type(Uint8.valueOf(59));
         icmpv6TypeCaseBuilder.setIcmpv6Type(icmpv6TypeBuilder.build());
         entryBuilder.setMatchEntryValue(icmpv6TypeCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -528,7 +531,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         Icmpv6CodeCaseBuilder icmpv6CodeCaseBuilder = new Icmpv6CodeCaseBuilder();
         Icmpv6CodeBuilder icmpv6CodeBuilder = new Icmpv6CodeBuilder();
-        icmpv6CodeBuilder.setIcmpv6Code((short) 60);
+        icmpv6CodeBuilder.setIcmpv6Code(Uint8.valueOf(60));
         icmpv6CodeCaseBuilder.setIcmpv6Code(icmpv6CodeBuilder.build());
         entryBuilder.setMatchEntryValue(icmpv6CodeCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -567,7 +570,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         MplsLabelCaseBuilder mplsLabelCaseBuilder = new MplsLabelCaseBuilder();
         MplsLabelBuilder mplsLabelBuilder = new MplsLabelBuilder();
-        mplsLabelBuilder.setMplsLabel(61L);
+        mplsLabelBuilder.setMplsLabel(Uint32.valueOf(61));
         mplsLabelCaseBuilder.setMplsLabel(mplsLabelBuilder.build());
         entryBuilder.setMatchEntryValue(mplsLabelCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -577,7 +580,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         MplsTcCaseBuilder mplsTcCaseBuilder = new MplsTcCaseBuilder();
         MplsTcBuilder mplsTcBuilder = new MplsTcBuilder();
-        mplsTcBuilder.setTc((short) 62);
+        mplsTcBuilder.setTc(Uint8.valueOf(62));
         mplsTcCaseBuilder.setMplsTc(mplsTcBuilder.build());
         entryBuilder.setMatchEntryValue(mplsTcCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -597,8 +600,8 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(true);
         PbbIsidCaseBuilder pbbIsidCaseBuilder = new PbbIsidCaseBuilder();
         PbbIsidBuilder pbbIsidBuilder = new PbbIsidBuilder();
-        pbbIsidBuilder.setIsid(64L);
-        pbbIsidBuilder.setMask(new byte[]{0,1,2});
+        pbbIsidBuilder.setIsid(Uint32.valueOf(64));
+        pbbIsidBuilder.setMask(new byte[]{0, 1, 2});
         pbbIsidCaseBuilder.setPbbIsid(pbbIsidBuilder.build());
         entryBuilder.setMatchEntryValue(pbbIsidCaseBuilder.build());
         entries.add(entryBuilder.build());
@@ -631,7 +634,7 @@ public class OF13MatchSerializer02Test {
         entryBuilder.setHasMask(false);
         PacketTypeCaseBuilder packetTypeCaseBuilder = new PacketTypeCaseBuilder();
         PacketTypeBuilder packetTypeBuilder = new PacketTypeBuilder();
-        packetTypeBuilder.setPacketType(0x1894fL);
+        packetTypeBuilder.setPacketType(Uint32.valueOf(0x1894f));
         packetTypeCaseBuilder.setPacketType(packetTypeBuilder.build());
         entryBuilder.setMatchEntryValue(packetTypeCaseBuilder.build());
         entries.add(entryBuilder.build());
index 6dc54e94fa4a16effc6b317e963e1c2cf93f9f83..909049001a76bffd2be81ccceb0623753b9af7c2 100644 (file)
@@ -51,6 +51,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.matc
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.src._case.Ipv6SrcBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -335,7 +336,7 @@ public class OF13MatchSerializerTest {
         entriesBuilder.setHasMask(hasMask);
         Ipv6FlabelCaseBuilder ipv6FlabelCaseBuilder = new Ipv6FlabelCaseBuilder();
         Ipv6FlabelBuilder ipv6FlabelBuilder = new Ipv6FlabelBuilder();
-        ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(labelValue));
+        ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(Uint32.valueOf(labelValue)));
         ipv6FlabelBuilder.setMask(mask);
         ipv6FlabelCaseBuilder.setIpv6Flabel(ipv6FlabelBuilder.build());
         entriesBuilder.setMatchEntryValue(ipv6FlabelCaseBuilder.build());
@@ -376,7 +377,7 @@ public class OF13MatchSerializerTest {
         builder.setHasMask(true);
         ExperimenterIdCaseBuilder caseBuilder = new ExperimenterIdCaseBuilder();
         ExperimenterBuilder expBuilder = new ExperimenterBuilder();
-        expBuilder.setExperimenter(new ExperimenterId(42L));
+        expBuilder.setExperimenter(new ExperimenterId(Uint32.valueOf(42)));
         caseBuilder.setExperimenter(expBuilder.build());
         builder.setMatchEntryValue(caseBuilder.build());
         entries.add(builder.build());