use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.arp.spa.grouping.NxmOfArpSpaBuilder in project openflowplugin by opendaylight.
the class ArpSpaConvertorTest method testConvertToOFJava.
@Test
public void testConvertToOFJava() throws Exception {
final NxmOfArpSpaBuilder nxmOfArpSpaBuilder = new NxmOfArpSpaBuilder().setIpv4Address(IPV4_ADDRESS);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
final MatchEntry converted = arpSpaConvertor.convert(extension);
Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS), ((ArpSpaCaseValue) converted.getMatchEntryValue()).getArpSpaValues().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.arp.spa.grouping.NxmOfArpSpaBuilder in project openflowplugin by opendaylight.
the class ArpSpaConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
ArpSpaCaseValue arpSpaCaseValue = (ArpSpaCaseValue) input.getMatchEntryValue();
Ipv4Address ipv4Address = IpConverter.longToIpv4Address(arpSpaCaseValue.getArpSpaValues().getValue());
return resolveAugmentation(new NxmOfArpSpaBuilder().setIpv4Address(ipv4Address).build(), path, NxmOfArpSpaKey.class);
}
Aggregations