use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIpv4SrcCaseValue in project openflowplugin by opendaylight.
the class TunIPv4SrcConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS), ((TunIpv4SrcCaseValue) converted.getMatchEntryValue()).getTunIpv4SrcValues().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIpv4SrcCaseValue 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.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIpv4SrcCaseValue in project openflowplugin by opendaylight.
the class TunIpv4SrcCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = tunIpv4SrcCodec.deserialize(buffer);
final TunIpv4SrcCaseValue result = (TunIpv4SrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunIpv4Src.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(1, result.getTunIpv4SrcValues().getValue().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIpv4SrcCaseValue in project openflowplugin by opendaylight.
the class TunIpv4SrcCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
TunIpv4SrcCaseValue caseValue = (TunIpv4SrcCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(caseValue.getTunIpv4SrcValues().getValue().intValue());
}
Aggregations