use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn 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.NxAugMatchNotifPacketIn 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn in project openflowplugin by opendaylight.
the class CtZoneConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final CtZoneValuesBuilder ctZoneValuesBuilder = new CtZoneValuesBuilder().setCtZone(2);
final CtZoneCaseValueBuilder ctZoneCaseValueBuilder = new CtZoneCaseValueBuilder().setCtZoneValues(ctZoneValuesBuilder.build());
final CtZoneCaseValue ctZoneCaseValue = ctZoneCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ctZoneCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctZoneConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctZoneConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn in project openflowplugin by opendaylight.
the class Nshc1ConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final Nshc1ValuesBuilder nshc1ValuesBuilder = new Nshc1ValuesBuilder().setNshc(Long.valueOf(1));
final Nshc1CaseValueBuilder nshc1CaseValueBuilder = new Nshc1CaseValueBuilder().setNshc1Values(nshc1ValuesBuilder.build());
final Nshc1CaseValue nshc1CaseValue = nshc1CaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nshc1CaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc1Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc1Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc1Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc1Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn in project openflowplugin by opendaylight.
the class TunIPv4DstConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TunIpv4DstValuesBuilder tunIpv4DstValuesBuilder = new TunIpv4DstValuesBuilder().setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder().setTunIpv4DstValues(tunIpv4DstValuesBuilder.build());
final TunIpv4DstCaseValue tunIpv4DstCaseValue = tunIpv4DstCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tunIpv4DstCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
}
Aggregations