X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2FStatisticsContextImplParamTest.java;h=aee1e8c0b2cf7c266ce2119b3b6a8beba39a161d;hb=a69004dee78ec69bc90d763ab5a353c7a6d2d189;hp=915dd009383273660d6cf17be0a4ac33bb7577ae;hpb=1aee9a9a8d8df9d3207696a98021295ae2e92ad7;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplParamTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplParamTest.java index 915dd00938..aee1e8c0b2 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplParamTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplParamTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.statistics; import static com.google.common.util.concurrent.Futures.immediateFuture; @@ -36,12 +35,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.opendaylight.yangtools.yang.common.Uint32; @RunWith(Parameterized.class) public class StatisticsContextImplParamTest extends StatisticsContextImpMockInitiation { @Mock - private OpenflowProviderConfig config = mock(OpenflowProviderConfig.class); + private final OpenflowProviderConfig config = mock(OpenflowProviderConfig.class); public StatisticsContextImplParamTest(final boolean isTable, final boolean isFlow, final boolean isGroup, final boolean isMeter, @@ -69,14 +69,14 @@ public class StatisticsContextImplParamTest extends StatisticsContextImpMockInit @Before public void setUp() { - Mockito.when(config.isIsTableStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.isIsFlowStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.isIsGroupStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.isIsMeterStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.isIsPortStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.isIsQueueStatisticsPollingOn()).thenReturn(true); - Mockito.when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(3000L)); - Mockito.when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(50000L)); + Mockito.when(config.getIsTableStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getIsFlowStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getIsGroupStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getIsMeterStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getIsPortStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getIsQueueStatisticsPollingOn()).thenReturn(true); + Mockito.when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(3000))); + Mockito.when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(Uint32.valueOf(50000))); } @Test @@ -109,7 +109,7 @@ public class StatisticsContextImplParamTest extends StatisticsContextImpMockInit statisticsContext.registerMastershipWatcher(mockedMastershipWatcher); statisticsContext.setStatisticsGatheringService(mockedStatisticsGatheringService); statisticsContext.setStatisticsGatheringOnTheFlyService(mockedStatisticsOnFlyGatheringService); - statisticsContext.instantiateServiceInstance(); + statisticsContext.initializeDevice(); verify(mockedStatisticsGatheringService, times(7)) .getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));