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%2FNspConvertorTest.java;h=f52fceb926bd3372a985e49f2c307b3cc046aec3;hb=229e6fd7c8540b8b87fd499b9cfe18aa427d2486;hp=87a8abf2e9e85a9ec5d5bde2f59072cf2f025714;hpb=a37af37bb414295b84582d5aa58dca955f2df49e;p=openflowplugin.git diff --git a/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertorTest.java b/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertorTest.java index 87a8abf2e9..f52fceb926 100644 --- a/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertorTest.java +++ b/extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertorTest.java @@ -49,19 +49,21 @@ public class NspConvertorTest { public void setUp() throws Exception { final NxmNxNspBuilder nxmNxNspBuilder = new NxmNxNspBuilder() .setValue(Long.valueOf(1L)); - final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder(); + final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = + new NxAugMatchNodesNodeTableFlowBuilder(); nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNsp(nxmNxNspBuilder.build()); final Augmentation extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build(); - when(extension.getAugmentation(Matchers.>>any())).thenReturn(extensionAugmentation); + when(extension.getAugmentation(Matchers.>>any())) + .thenReturn(extensionAugmentation); nspConvertor = new NspConvertor(); } @Test public void testConvert() throws Exception { - final MatchEntry matchEntry = nspConvertor.convert(extension); - Assert.assertEquals(1, ((NspCaseValue)matchEntry.getMatchEntryValue()).getNspValues().getNsp().intValue()); + final MatchEntry converted = nspConvertor.convert(extension); + Assert.assertEquals(1, ((NspCaseValue)converted.getMatchEntryValue()).getNspValues().getNsp().intValue()); } @Test @@ -75,20 +77,28 @@ public class NspConvertorTest { when(matchEntry.getMatchEntryValue()).thenReturn(nspCaseValue); - final ExtensionAugment> extensionAugment = nspConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH); - Assert.assertEquals(2, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNsp().getValue().longValue()); + final ExtensionAugment> 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> extensionAugment1 = nspConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH); - Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNsp().getValue().longValue()); + final ExtensionAugment> 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> extensionAugment2 = nspConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH); - Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNsp().getValue().longValue()); + final ExtensionAugment> 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> extensionAugment3 = nspConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH); - Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNsp().getValue().longValue()); + final ExtensionAugment> extensionAugment3 = nspConvertor.convert(matchEntry, + MatchPath.FLOWS_STATISTICS_RPC_MATCH); + Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsp() + .getValue().longValue()); Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class); } }