use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder in project openflowplugin by opendaylight.
the class StatisticsManagerImplTest method testChangeStatisticsWorkMode2.
/**
* Switching to {@link StatisticsWorkMode#FULLYDISABLED}; with pollTimeout and lifecycleRegistry.
*/
@Test
public void testChangeStatisticsWorkMode2() throws Exception {
final StatisticsContext statisticContext = Mockito.mock(StatisticsContext.class);
getContextsMap(statisticsManager).put(deviceInfo, statisticContext);
final ChangeStatisticsWorkModeInputBuilder changeStatisticsWorkModeInputBld = new ChangeStatisticsWorkModeInputBuilder().setMode(StatisticsWorkMode.FULLYDISABLED);
Future<RpcResult<Void>> workMode = statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
checkWorkModeChangeOutcome(workMode);
verify(statisticContext).disableGathering();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder in project openflowplugin by opendaylight.
the class StatisticsManagerImplTest method testChangeStatisticsWorkMode3.
/**
* Tests switching to {@link StatisticsWorkMode#FULLYDISABLED} and back
* to {@link StatisticsWorkMode#COLLECTALL}; with lifecycleRegistry and pollTimeout.
*/
@Test
public void testChangeStatisticsWorkMode3() throws Exception {
final StatisticsContext statisticContext = Mockito.mock(StatisticsContext.class);
getContextsMap(statisticsManager).put(deviceInfo, statisticContext);
final ChangeStatisticsWorkModeInputBuilder changeStatisticsWorkModeInputBld = new ChangeStatisticsWorkModeInputBuilder().setMode(StatisticsWorkMode.FULLYDISABLED);
Future<RpcResult<Void>> workMode;
workMode = statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
checkWorkModeChangeOutcome(workMode);
verify(statisticContext).disableGathering();
changeStatisticsWorkModeInputBld.setMode(StatisticsWorkMode.COLLECTALL);
workMode = statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
checkWorkModeChangeOutcome(workMode);
verify(statisticContext).enableGathering();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder in project openflowplugin by opendaylight.
the class StatisticsManagerImplTest method testChangeStatisticsWorkMode1.
/**
* switching to {@link StatisticsWorkMode#FULLYDISABLED}; no pollTimeout and no lifecycleRegistry.
*/
@Test
public void testChangeStatisticsWorkMode1() throws Exception {
final StatisticsContext statisticContext = Mockito.mock(StatisticsContext.class);
getContextsMap(statisticsManager).put(deviceInfo, statisticContext);
final ChangeStatisticsWorkModeInputBuilder changeStatisticsWorkModeInputBld = new ChangeStatisticsWorkModeInputBuilder().setMode(StatisticsWorkMode.FULLYDISABLED);
final Future<RpcResult<Void>> workMode = statisticsManager.changeStatisticsWorkMode(changeStatisticsWorkModeInputBld.build());
checkWorkModeChangeOutcome(workMode);
verify(statisticContext).disableGathering();
}
Aggregations