* 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;
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,
@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
statisticsContext.registerMastershipWatcher(mockedMastershipWatcher);
statisticsContext.setStatisticsGatheringService(mockedStatisticsGatheringService);
statisticsContext.setStatisticsGatheringOnTheFlyService(mockedStatisticsOnFlyGatheringService);
- statisticsContext.instantiateServiceInstance();
+ statisticsContext.initializeDevice();
verify(mockedStatisticsGatheringService, times(7))
.getStatisticsOfType(any(EventIdentifier.class), any(MultipartType.class));