use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn 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.NxAugMatchNotifPacketIn 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn in project openflowplugin by opendaylight.
the class TcpSrcConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TcpSrcValuesBuilder tcpSrcValuesBuilder = new TcpSrcValuesBuilder().setMask(2).setPort(DEFAULT_PORT);
final TcpSrcCaseValueBuilder tcpSrcCaseValueBuilder = new TcpSrcCaseValueBuilder().setTcpSrcValues(tcpSrcValuesBuilder.build());
final TcpSrcCaseValue tcpSrcCaseValue = tcpSrcCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tcpSrcCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpSrcConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpSrc().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpSrcConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfTcpSrc().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpSrc().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
}
Aggregations