Bump upstreams for 2022.09 Chlorine
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / TableFeaturesResponseConvertorTest.java
index 6494612a4e89ab74db62b34246b3b46a5c90f558..a5e76bcf29bd82f2b1046a57478c9910537589ed 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.openflowplugin.openflow.md.core.sal.convertor;
 
 import java.util.ArrayList;
@@ -24,8 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeaturePropertyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeaturePropertyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.next.table.related.table.feature.property.NextTableIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.next.table.related.table.feature.property.NextTableIdsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
@@ -168,7 +167,7 @@ public class TableFeaturesResponseConvertorTest {
         Assert.assertEquals("Wrong name", "Aloha", feature.getName());
         Assert.assertEquals("Wrong metadata match", Uint64.valueOf("0001020304050607", 16), feature.getMetadataMatch());
         Assert.assertEquals("Wrong metadata write", Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataWrite());
-        Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+        Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
         Assert.assertEquals("Wrong max-entries", 42, feature.getMaxEntries().intValue());
         Assert.assertEquals("Wrong properties", 0, feature.getTableProperties().nonnullTableFeatureProperties().size());
     }
@@ -299,15 +298,15 @@ public class TableFeaturesResponseConvertorTest {
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTMATCH);
         MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(InPhyPort.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(InPhyPort.VALUE);
         entriesBuilder.setHasMask(false);
 
         List<MatchEntry> entries = new ArrayList<>();
         entries.add(entriesBuilder.build());
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(InPort.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(InPort.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
 
@@ -320,13 +319,13 @@ public class TableFeaturesResponseConvertorTest {
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD);
         entries = new ArrayList<>();
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(IpProto.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(IpProto.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(IpEcn.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(IpEcn.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().setMatchEntry(entries).build());
@@ -338,13 +337,13 @@ public class TableFeaturesResponseConvertorTest {
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELD);
         entries = new ArrayList<>();
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(Ipv6Exthdr.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(Ipv6Exthdr.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(VlanVid.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(VlanVid.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().setMatchEntry(entries).build());
@@ -356,13 +355,13 @@ public class TableFeaturesResponseConvertorTest {
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS);
         entries = new ArrayList<>();
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(VlanPcp.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(VlanPcp.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(TcpSrc.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(TcpSrc.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
         propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().setMatchEntry(entries).build());
@@ -374,14 +373,14 @@ public class TableFeaturesResponseConvertorTest {
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS);
         entries = new ArrayList<>();
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(UdpSrc.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(UdpSrc.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
 
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(UdpDst.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(UdpDst.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
 
@@ -395,14 +394,14 @@ public class TableFeaturesResponseConvertorTest {
         entries = new ArrayList<>();
 
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(EthSrc.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(EthSrc.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
 
         entriesBuilder = new MatchEntryBuilder();
-        entriesBuilder.setOxmClass(OpenflowBasicClass.class);
-        entriesBuilder.setOxmMatchField(EthDst.class);
+        entriesBuilder.setOxmClass(OpenflowBasicClass.VALUE);
+        entriesBuilder.setOxmMatchField(EthDst.VALUE);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
 
@@ -521,7 +520,7 @@ public class TableFeaturesResponseConvertorTest {
         Assert.assertEquals("Wrong name", "Aloha", feature.getName());
         Assert.assertEquals("Wrong metadata match", Uint64.valueOf("0001020304050607", 16), feature.getMetadataMatch());
         Assert.assertEquals("Wrong metadata write",Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataWrite());
-        Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+        Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
         Assert.assertEquals("Wrong max-entries", 42, feature.getMaxEntries().intValue());
         Assert.assertEquals("Wrong properties", 4, feature.getTableProperties().nonnullTableFeatureProperties().size());
 
@@ -588,7 +587,7 @@ public class TableFeaturesResponseConvertorTest {
         Assert.assertEquals("Wrong name", "Mahalo", feature.getName());
         Assert.assertEquals("Wrong metadata match", Uint64.valueOf("08090A0B0C0D0E0F", 16), feature.getMetadataMatch());
         Assert.assertEquals("Wrong metadata write", Uint64.valueOf("0001020304050607", 16), feature.getMetadataWrite());
-        Assert.assertEquals("Wrong config", false, feature.getConfig().isDEPRECATEDMASK());
+        Assert.assertEquals("Wrong config", false, feature.getConfig().getDEPRECATEDMASK());
         Assert.assertEquals("Wrong max-entries", 24, feature.getMaxEntries().intValue());
         Assert.assertEquals("Wrong properties", 12, feature.getTableProperties().getTableFeatureProperties().size());
         featProps = feature.getTableProperties().nonnullTableFeatureProperties().values().iterator();
@@ -600,10 +599,10 @@ public class TableFeaturesResponseConvertorTest {
         Collection<SetFieldMatch> fieldMatch = propType5.getMatchSetfield().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         Iterator<SetFieldMatch> fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
-            + "rev131026.InPhyPort", fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
-            + "rev131026.InPort", fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort.VALUE,
+                fieldIt.next().getMatchType());
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
             + "rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield",
@@ -612,12 +611,10 @@ public class TableFeaturesResponseConvertorTest {
         fieldMatch = propType6.getApplySetfield().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto",
-                fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn",
-                fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn.VALUE,
+                fieldIt.next().getMatchType());
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
             + "rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield",
@@ -626,12 +623,10 @@ public class TableFeaturesResponseConvertorTest {
         fieldMatch = propType7.getWriteSetfield().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr",
-                fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid",
-                fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid.VALUE,
+                fieldIt.next().getMatchType());
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
             + "rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMiss",
@@ -640,12 +635,10 @@ public class TableFeaturesResponseConvertorTest {
         fieldMatch = propType8.getWriteSetfieldMiss().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp",
-                fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc",
-                fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc.VALUE,
+                fieldIt.next().getMatchType());
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
             + "rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss",
@@ -654,12 +647,10 @@ public class TableFeaturesResponseConvertorTest {
         fieldMatch = propType9.getApplySetfieldMiss().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc",
-                fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst",
-                fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst.VALUE,
+                fieldIt.next().getMatchType());
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."
             + "rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards",
@@ -668,12 +659,10 @@ public class TableFeaturesResponseConvertorTest {
         fieldMatch = propType10.getWildcardSetfield().nonnullSetFieldMatch().values();
         Assert.assertEquals("Wrong match-entry-ids size", 2, fieldMatch.size());
         fieldIt = fieldMatch.iterator();
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc",
-                fieldIt.next().getMatchType().getName());
-        Assert.assertEquals("Wrong match-entry-id",
-                "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst",
-                fieldIt.next().getMatchType().getName());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc.VALUE,
+                fieldIt.next().getMatchType());
+        Assert.assertEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst.VALUE,
+                fieldIt.next().getMatchType());
 
         property = featProps.next();
         Assert.assertEquals("Wrong property type", "org.opendaylight.yang.gen.v1.urn.opendaylight.table.types."