use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow 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.NxAugMatchNodesNodeTableFlow 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.NxAugMatchNodesNodeTableFlow 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class TunIdConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TunIdValuesBuilder tunIdValuesBuilder = new TunIdValuesBuilder().setValue(BigInteger.TEN);
final TunIdCaseValueBuilder tunIdCaseValueBuilder = new TunIdCaseValueBuilder().setTunIdValues(tunIdValuesBuilder.build());
final TunIdCaseValue tunIdCaseValue = tunIdCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tunIdCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIdConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIdConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIdConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIdConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow in project openflowplugin by opendaylight.
the class NspConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final NspValuesBuilder nspValuesBuilder = new NspValuesBuilder().setNsp(Long.valueOf(2L));
final NspCaseValueBuilder nspCaseValueBuilder = new NspCaseValueBuilder().setNspValues(nspValuesBuilder.build());
final NspCaseValue nspCaseValue = nspCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nspCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nspConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nspConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nspConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nspConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
}
Aggregations