use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkMatchNshMdType1.
private void checkMatchNshMdType1(Match match) {
GeneralAugMatchNodesNodeTableFlow genAug = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNshMdtype() != null) {
assertEquals(nxAugMatch.getNxmNxNshMdtype().getValue().shortValue(), OpenFlow13Provider.NSH_MDTYPE_ONE);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkMatchC1.
private void checkMatchC1(Match match, long c1) {
GeneralAugMatchNodesNodeTableFlow genAug = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNshc1() != null) {
assertEquals(nxAugMatch.getNxmNxNshc1().getValue().longValue(), c1);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkMatchNsi.
private void checkMatchNsi(Match match, short nsi) {
GeneralAugMatchNodesNodeTableFlow genAug = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
assertNotNull(genAug);
List<ExtensionList> extensions = genAug.getExtensionList();
for (ExtensionList extensionList : extensions) {
Extension extension = extensionList.getExtension();
NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
if (nxAugMatch.getNxmNxNsi() != null) {
assertEquals(nxAugMatch.getNxmNxNsi().getNsi().shortValue(), nsi);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class EthTypeConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final EthTypeValuesBuilder ethTypeValuesBuilder = new EthTypeValuesBuilder().setValue(Integer.valueOf(1));
final EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder().setEthTypeValues(ethTypeValuesBuilder.build());
final EthTypeCaseValue ethTypeCaseValue = ethTypeCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ethTypeCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethTypeConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethTypeConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethTypeConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethTypeConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class Nshc2ConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final Nshc2ValuesBuilder nshc2ValuesBuilder = new Nshc2ValuesBuilder().setNshc(Long.valueOf(1));
final Nshc2CaseValueBuilder nshc2CaseValueBuilder = new Nshc2CaseValueBuilder().setNshc2Values(nshc2ValuesBuilder.build());
final Nshc2CaseValue nshc2CaseValue = nshc2CaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nshc2CaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc2Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc2Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc2Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc2Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
}
Aggregations