X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=extension%2Fopenflowplugin-extension-nicira%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fextension%2Fvendor%2Fnicira%2Fconvertor%2Fmatch%2FArpSpaConvertorTest.java;h=c4d3033223bec21684d69a872e656b6bf1c52f77;hb=229e6fd7c8540b8b87fd499b9cfe18aa427d2486;hp=f9c5f8a27e7ea2047c846a9cbd971a7639c73866;hpb=1ed0bb5f2bffe9e1918df6febbb5add7bb5ace8e;p=openflowplugin.git diff --git a/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertorTest.java b/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertorTest.java index f9c5f8a27e..c4d3033223 100644 --- a/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertorTest.java +++ b/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertorTest.java @@ -63,16 +63,18 @@ public class ArpSpaConvertorTest { nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build()); final Augmentation extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build(); - when(extension.getAugmentation(Matchers.>>any())).thenReturn(extensionAugmentation); + when(extension.getAugmentation(Matchers.>>any())) + .thenReturn(extensionAugmentation); - final MatchEntry matchEntry = arpSpaConvertor.convert(extension); - Assert.assertEquals(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS), ((ArpSpaCaseValue)matchEntry.getMatchEntryValue()).getArpSpaValues().getValue().longValue()); + final MatchEntry converted = arpSpaConvertor.convert(extension); + Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS), + ((ArpSpaCaseValue) converted.getMatchEntryValue()).getArpSpaValues().getValue().longValue()); } @Test public void testConvertFromOFJava() throws Exception { final ArpSpaValuesBuilder arpSpaValuesBuilder = new ArpSpaValuesBuilder() - .setValue(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS)); + .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS)); final ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder() .setArpSpaValues(arpSpaValuesBuilder.build()); @@ -80,22 +82,28 @@ public class ArpSpaConvertorTest { when(matchEntry.getMatchEntryValue()).thenReturn(arpSpaCaseValue); - final ExtensionAugment> extensionAugment = arpSpaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH); - Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address()); + final ExtensionAugment> extensionAugment = arpSpaConvertor.convert(matchEntry, + MatchPath.PACKET_RECEIVED_MATCH); + Assert.assertEquals(IPV4_ADDRESS, + ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address()); Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class); - final ExtensionAugment> extensionAugment1 = arpSpaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH); - Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address()); + final ExtensionAugment> extensionAugment1 = arpSpaConvertor + .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH); + Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()) + .getNxmOfArpSpa().getIpv4Address()); Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class); - final ExtensionAugment> extensionAugment2 = arpSpaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH); - Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address()); + final ExtensionAugment> extensionAugment2 = arpSpaConvertor + .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH); + Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()) + .getNxmOfArpSpa().getIpv4Address()); Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class); - final ExtensionAugment> extensionAugment3 = arpSpaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH); - Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address()); + final ExtensionAugment> extensionAugment3 = arpSpaConvertor + .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH); + Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()) + .getNxmOfArpSpa().getIpv4Address()); Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class); - } - }