use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkMatchC2.
private void checkMatchC2(Match match, long c2) {
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.getNxmNxNshc2() != null) {
assertEquals(nxAugMatch.getNxmNxNshc2().getValue().longValue(), c2);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class ArpThaConvertorTest method testConvertFromOFJava.
@Test
public void testConvertFromOFJava() throws Exception {
final ArpThaValuesBuilder arpThaValuesBuilder = new ArpThaValuesBuilder().setMacAddress(MAC_ADDRESS);
final ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder().setArpThaValues(arpThaValuesBuilder.build());
final ArpThaCaseValue arpThaCaseValue = arpThaCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpThaCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class ArpOpConvertorTest method testConvertFromOFJava.
@Test
public void testConvertFromOFJava() throws Exception {
final ArpOpBuilder arpOpBuilder = new ArpOpBuilder().setOpCode(2);
final ArpOpCaseBuilder arpOpCaseBuilder = new ArpOpCaseBuilder().setArpOp(arpOpBuilder.build());
final ArpOpCase arpOpCase = arpOpCaseBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpOpCase);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpOpConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpOp().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpOpKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpOpConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNodesNodeTableFlow) extensionAugment1.getAugmentationObject()).getNxmOfArpOp().getValue());
Assert.assertEquals(extensionAugment1.getKey(), NxmOfArpOpKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpOpConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment2.getAugmentationObject()).getNxmOfArpOp().getValue());
Assert.assertEquals(extensionAugment2.getKey(), NxmOfArpOpKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpOpConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfArpOp().getValue());
Assert.assertEquals(extensionAugment3.getKey(), NxmOfArpOpKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class ArpSpaConvertorTest method testConvertFromOFJava.
@Test
public void testConvertFromOFJava() throws Exception {
final ArpSpaValuesBuilder arpSpaValuesBuilder = new ArpSpaValuesBuilder().setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder().setArpSpaValues(arpSpaValuesBuilder.build());
final ArpSpaCaseValue arpSpaCaseValue = arpSpaCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpSpaCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpSpaConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpSpaConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpSpaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpSpaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class ArpTpaConvertorTest method testConvertToOFJava.
@Test
public void testConvertToOFJava() throws Exception {
final ArpTpaValuesBuilder arpTpaValuesBuilder = new ArpTpaValuesBuilder().setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder().setArpTpaValues(arpTpaValuesBuilder.build());
final ArpTpaCaseValue arpTpaCaseValue = arpTpaCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpTpaCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpTpaConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpTpaConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpTpaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpTpaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
}
Aggregations