use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class Nshc4ConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final Nshc4ValuesBuilder nshc4ValuesBuilder = new Nshc4ValuesBuilder().setNshc(Long.valueOf(1));
final Nshc4CaseValueBuilder nshc4CaseValueBuilder = new Nshc4CaseValueBuilder().setNshc4Values(nshc4ValuesBuilder.build());
final Nshc4CaseValue nshc4CaseValue = nshc4CaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nshc4CaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc4Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc4Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc4Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc4Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class TunIPv4SrcConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TunIpv4SrcValuesBuilder tunIpv4SrcValuesBuilder = new TunIpv4SrcValuesBuilder().setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
final TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder().setTunIpv4SrcValues(tunIpv4SrcValuesBuilder.build());
final TunIpv4SrcCaseValue tunIpv4SrcCaseValue = tunIpv4SrcCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tunIpv4SrcCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class UdpDstConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final UdpDstValuesBuilder udpDstValuesBuilder = new UdpDstValuesBuilder().setMask(2).setPort(DEFAULT_PORT);
final UdpDstCaseValueBuilder udpDstCaseValueBuilder = new UdpDstCaseValueBuilder().setUdpDstValues(udpDstValuesBuilder.build());
final UdpDstCaseValue udpDstCaseValue = udpDstCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(udpDstCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = udpDstConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getMask());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = udpDstConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfUdpDst().getMask());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfUdpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = udpDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getMask());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = udpDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getMask());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class EthSrcConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final EthSrcValuesBuilder ethSrcValuesBuilder = new EthSrcValuesBuilder().setMacAddress(MAC_ADDRESS);
final EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder().setEthSrcValues(ethSrcValuesBuilder.build());
final EthSrcCaseValue ethSrcCaseValue = ethSrcCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ethSrcCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethSrcConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethSrcConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class Nshc3ConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final Nshc3ValuesBuilder nshc3ValuesBuilder = new Nshc3ValuesBuilder().setNshc(Long.valueOf(1));
final Nshc3CaseValueBuilder nshc3CaseValueBuilder = new Nshc3CaseValueBuilder().setNshc3Values(nshc3ValuesBuilder.build());
final Nshc3CaseValue nshc3CaseValue = nshc3CaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nshc3CaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc3Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc3Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc3Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc3Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
}
Aggregations