use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.
the class NsiConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final NsiValuesBuilder nsiValuesBuilder = new NsiValuesBuilder().setNsi(Short.valueOf((short) 1));
final NsiCaseValueBuilder nsiCaseValueBuilder = new NsiCaseValueBuilder().setNsiValues(nsiValuesBuilder.build());
final NsiCaseValue nsiCaseValue = nsiCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nsiCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nsiConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nsiConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nsiConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nsiConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.
the class TcpDstConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TcpDstValuesBuilder tcpDstValuesBuilder = new TcpDstValuesBuilder().setMask(2).setPort(DEFAULT_PORT);
final TcpDstCaseValueBuilder tcpDstCaseValueBuilder = new TcpDstCaseValueBuilder().setTcpDstValues(tcpDstValuesBuilder.build());
final TcpDstCaseValue tcpDstCaseValue = tcpDstCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tcpDstCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpDstConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpDstConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfTcpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpDst().getPort());
Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.
the class TcpDstConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = tcpDstConvertor.convert(extension);
Assert.assertEquals(1, ((TcpDstCaseValue) converted.getMatchEntryValue()).getTcpDstValues().getMask().intValue());
Assert.assertEquals(DEFAULT_PORT, ((TcpDstCaseValue) converted.getMatchEntryValue()).getTcpDstValues().getPort());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.
the class TunIPv4DstConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS), ((TunIpv4DstCaseValue) converted.getMatchEntryValue()).getTunIpv4DstValues().getValue().longValue());
}
Aggregations