Change OFConstants.OFPCML_NO_BUFFER to Uint16 78/92378/7
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Sep 2020 12:50:18 +0000 (14:50 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 7 Sep 2020 08:12:52 +0000 (10:12 +0200)
We are using this constant only for builders, change it to Uint16
so that we skip any conversion.

JIRA: OPNFLWPLUG-1099
Change-Id: Ie59302d05b8ce3d2cad91f30c84038a05cd1e651
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/of-switch-config-pusher/src/test/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusherTest.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PacketOutConvertorTest.java

index 0df7404a676ad501c6479bddc677e4eb7632e591..27d7ebab7b80bfcc5cd475ba197d5d9084bac8b4 100644 (file)
@@ -40,7 +40,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.Set
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.opendaylight.yangtools.yang.common.Uint16;
 
 /**
  * Test for {@link DefaultConfigPusher}.
@@ -78,7 +77,7 @@ public class DefaultConfigPusherTest {
         Mockito.verify(nodeConfigService).setConfig(setConfigInputCaptor.capture());
         final SetConfigInput captured = setConfigInputCaptor.getValue();
         Assert.assertEquals(SwitchConfigFlag.FRAGNORMAL.toString(), captured.getFlag());
-        Assert.assertEquals(Uint16.valueOf(OFConstants.OFPCML_NO_BUFFER), captured.getMissSearchLength());
+        Assert.assertEquals(OFConstants.OFPCML_NO_BUFFER, captured.getMissSearchLength());
         Assert.assertEquals(NODE_IID, captured.getNode().getValue());
     }
 
index 07b43308f78963badb30b33e3623873163c3ebbc..5a9871e6cbad865c97198ac0258259aa243c81fe 100644 (file)
@@ -68,7 +68,7 @@ public final class OFConstants {
     public static final Uint32 OFP_NO_BUFFER = Uint32.valueOf(0xffffffffL).intern();
     /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be
      *  sent to the controller. */
-    public static final Integer OFPCML_NO_BUFFER = 0xffff;
+    public static final Uint16 OFPCML_NO_BUFFER = Uint16.MAX_VALUE;
 
     public static final int MAC_ADDRESS_LENGTH = 6;
     public static final int SIZE_OF_LONG_IN_BYTES = 8;
index ccbbef9774075fe3bf4c0c050b420bcb23f2477c..2c02b576de7f9568e62922de2480ef39d62c163c 100644 (file)
@@ -110,7 +110,7 @@ public class PacketOutConvertorTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder();
 
         OutputActionBuilder output = new OutputActionBuilder();
-        output.setMaxLength(Uint16.valueOf(OFConstants.OFPCML_NO_BUFFER));
+        output.setMaxLength(OFConstants.OFPCML_NO_BUFFER);
         Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(