Search in sources :

Example 1 with GeneralAugMatchNodesNodeTableFlowWriteActionsSetField

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetField in project openflowplugin by opendaylight.

the class SetFieldExtensionTest method testGetExtension.

@Test
public void testGetExtension() {
    GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup = new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
    eqGroup.add(GeneralAugMatchRpcAddFlowWriteActionsSetField.class);
    eqGroup.add(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class);
    SetFieldBuilder sb1 = new SetFieldBuilder();
    ExtensionList extension1 = new ExtensionListBuilder().setExtensionKey(ZVendorExt1.class).build();
    GeneralAugMatchRpcAddFlowWriteActionsSetField odlxxx1 = new GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder().setExtensionList(Collections.singletonList(extension1)).build();
    SetField setField1 = sb1.addAugmentation(GeneralAugMatchRpcAddFlowWriteActionsSetField.class, odlxxx1).build();
    SetFieldBuilder sb2 = new SetFieldBuilder();
    ExtensionList extension2 = new ExtensionListBuilder().setExtensionKey(ZVendorExt2.class).build();
    GeneralAugMatchNodesNodeTableFlowWriteActionsSetField odlxxx2 = new GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder().setExtensionList(Collections.singletonList(extension2)).build();
    SetField setField2 = sb2.addAugmentation(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class, odlxxx2).build();
    Assert.assertEquals(ZVendorExt1.class, eqGroup.getExtension(setField1).get().getExtensionList().get(0).getExtensionKey());
    Assert.assertEquals(ZVendorExt2.class, eqGroup.getExtension(setField2).get().getExtensionList().get(0).getExtensionKey());
}
Also used : ExtensionListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionListBuilder) GeneralExtensionListGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionListGrouping) SetField(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetField) GeneralAugMatchRpcAddFlowWriteActionsSetField(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetField) GeneralAugMatchNodesNodeTableFlowWriteActionsSetField(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetField) GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder) SetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder) GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder) GeneralAugMatchRpcAddFlowWriteActionsSetField(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetField) GeneralAugMatchNodesNodeTableFlowWriteActionsSetField(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetField) GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder) ExtensionList(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList) GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SetField (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetField)1 SetFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder)1 GeneralAugMatchNodesNodeTableFlowWriteActionsSetField (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetField)1 GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder)1 GeneralAugMatchRpcAddFlowWriteActionsSetField (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetField)1 GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder)1 GeneralExtensionListGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionListGrouping)1 ExtensionList (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList)1 ExtensionListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionListBuilder)1