Clean up use of deprecated methods
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / multipart / MultipartRequestTableFeaturesTest.java
index 2a7c9f963694d588643cccd552ed85558a679771..8fd90bfbbaa9318951edb96c3d409cb264b60c8b 100644 (file)
@@ -30,15 +30,10 @@ import org.opendaylight.openflowjava.protocol.impl.serialization.factories.Multi
 import org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactoryTest;
 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeatureProperty;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdTableFeatureProperty;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeatureProperty;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty;
 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;
@@ -124,21 +119,15 @@ public class MultipartRequestTableFeaturesTest {
         tableFeaturesBuilder.setMaxEntries(65L);
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLES);
-        NextTableRelatedTableFeaturePropertyBuilder nextPropBuilder =
-                new NextTableRelatedTableFeaturePropertyBuilder();
         List<NextTableIds> nextIds = new ArrayList<>();
         nextIds.add(new NextTableIdsBuilder().setTableId((short) 1).build());
         nextIds.add(new NextTableIdsBuilder().setTableId((short) 2).build());
-        nextPropBuilder.setNextTableIds(nextIds);
-        propBuilder.addAugmentation(NextTableRelatedTableFeatureProperty.class, nextPropBuilder.build());
+        propBuilder.addAugmentation(new NextTableRelatedTableFeaturePropertyBuilder().setNextTableIds(nextIds).build());
         List<TableFeatureProperties> properties = new ArrayList<>();
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS);
-        nextPropBuilder = new NextTableRelatedTableFeaturePropertyBuilder();
-        nextIds = new ArrayList<>();
-        nextPropBuilder.setNextTableIds(nextIds);
-        propBuilder.addAugmentation(NextTableRelatedTableFeatureProperty.class, nextPropBuilder.build());
+        propBuilder.addAugmentation(new NextTableRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTINSTRUCTIONS);
@@ -149,14 +138,10 @@ public class MultipartRequestTableFeaturesTest {
         insBuilder = new InstructionBuilder();
         insBuilder.setInstructionChoice(new GotoTableCaseBuilder().build());
         insIds.add(insBuilder.build());
-        InstructionRelatedTableFeaturePropertyBuilder insPropBuilder =
-                new InstructionRelatedTableFeaturePropertyBuilder();
-        insPropBuilder.setInstruction(insIds);
-        propBuilder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insPropBuilder.build());
+        propBuilder.addAugmentation(new InstructionRelatedTableFeaturePropertyBuilder().setInstruction(insIds).build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS);
-        insPropBuilder = new InstructionRelatedTableFeaturePropertyBuilder();
         insIds = new ArrayList<>();
         insBuilder = new InstructionBuilder();
         insBuilder.setInstructionChoice(new WriteMetadataCaseBuilder().build());
@@ -173,8 +158,7 @@ public class MultipartRequestTableFeaturesTest {
         insBuilder = new InstructionBuilder();
         insBuilder.setInstructionChoice(new GotoTableCaseBuilder().build());
         insIds.add(insBuilder.build());
-        insPropBuilder.setInstruction(insIds);
-        propBuilder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insPropBuilder.build());
+        propBuilder.addAugmentation(new InstructionRelatedTableFeaturePropertyBuilder().setInstruction(insIds).build());
         properties.add(propBuilder.build());
         tableFeaturesBuilder.setTableFeatureProperties(properties);
         List<TableFeatures> tableFeaturesList = new ArrayList<>();
@@ -191,34 +175,23 @@ public class MultipartRequestTableFeaturesTest {
         properties = new ArrayList<>();
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITEACTIONS);
-        ActionRelatedTableFeaturePropertyBuilder actBuilder = new ActionRelatedTableFeaturePropertyBuilder();
         List<Action> actions = new ArrayList<>();
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(new OutputActionCaseBuilder().build());
         actions.add(actionBuilder.build());
-        actBuilder.setAction(actions);
-        propBuilder.addAugmentation(ActionRelatedTableFeatureProperty.class, actBuilder.build());
+        propBuilder.addAugmentation(new ActionRelatedTableFeaturePropertyBuilder().setAction(actions).build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITEACTIONSMISS);
-        actBuilder = new ActionRelatedTableFeaturePropertyBuilder();
-        actions = new ArrayList<>();
-        actBuilder.setAction(actions);
-        propBuilder.addAugmentation(ActionRelatedTableFeatureProperty.class, actBuilder.build());
+        propBuilder.addAugmentation(new ActionRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYACTIONS);
-        actBuilder = new ActionRelatedTableFeaturePropertyBuilder();
-        actions = new ArrayList<>();
-        actBuilder.setAction(actions);
-        propBuilder.addAugmentation(ActionRelatedTableFeatureProperty.class, actBuilder.build());
+        propBuilder.addAugmentation(new ActionRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS);
-        actBuilder = new ActionRelatedTableFeaturePropertyBuilder();
-        actions = new ArrayList<>();
-        actBuilder.setAction(actions);
-        propBuilder.addAugmentation(ActionRelatedTableFeatureProperty.class, actBuilder.build());
+        propBuilder.addAugmentation(new ActionRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTMATCH);
@@ -233,34 +206,22 @@ public class MultipartRequestTableFeaturesTest {
         entriesBuilder.setOxmMatchField(InPort.class);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
-        OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().setMatchEntry(entries).build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWILDCARDS);
-        oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        entries = new ArrayList<>();
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELD);
-        oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        entries = new ArrayList<>();
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS);
-        oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        entries = new ArrayList<>();
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD);
-        oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
         entries = new ArrayList<>();
         entriesBuilder = new MatchEntryBuilder();
         entriesBuilder.setOxmClass(OpenflowBasicClass.class);
@@ -272,15 +233,11 @@ public class MultipartRequestTableFeaturesTest {
         entriesBuilder.setOxmMatchField(IpEcn.class);
         entriesBuilder.setHasMask(false);
         entries.add(entriesBuilder.build());
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().setMatchEntry(entries).build());
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS);
-        oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
-        entries = new ArrayList<>();
-        oxmBuilder.setMatchEntry(entries);
-        propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
+        propBuilder.addAugmentation(new OxmRelatedTableFeaturePropertyBuilder().build());
         properties.add(propBuilder.build());
         tableFeaturesBuilder.setTableFeatureProperties(properties);
         tableFeaturesList.add(tableFeaturesBuilder.build());
@@ -421,16 +378,16 @@ public class MultipartRequestTableFeaturesTest {
         tableFeaturesBuilder.setMaxEntries(65L);
         TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTEXPERIMENTER);
-        ExperimenterIdTableFeaturePropertyBuilder expBuilder = new ExperimenterIdTableFeaturePropertyBuilder();
-        expBuilder.setExperimenter(new ExperimenterId(42L));
-        propBuilder.addAugmentation(ExperimenterIdTableFeatureProperty.class, expBuilder.build());
+        propBuilder.addAugmentation(new ExperimenterIdTableFeaturePropertyBuilder()
+            .setExperimenter(new ExperimenterId(42L))
+            .build());
         List<TableFeatureProperties> properties = new ArrayList<>();
         properties.add(propBuilder.build());
         propBuilder = new TableFeaturePropertiesBuilder();
         propBuilder.setType(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS);
-        expBuilder = new ExperimenterIdTableFeaturePropertyBuilder();
-        expBuilder.setExperimenter(new ExperimenterId(43L));
-        propBuilder.addAugmentation(ExperimenterIdTableFeatureProperty.class, expBuilder.build());
+        propBuilder.addAugmentation(new ExperimenterIdTableFeaturePropertyBuilder()
+            .setExperimenter(new ExperimenterId(43L))
+            .build());
         properties.add(propBuilder.build());
         tableFeaturesBuilder.setTableFeatureProperties(properties);
         List<TableFeatures> tableFeaturesList = new ArrayList<>();