Search in sources :

Example 1 with ChangeStatisticsWorkModeInputBuilder

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();
}
Also used : ChangeStatisticsWorkModeInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) StatisticsContext(org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext) Test(org.junit.Test)

Example 2 with ChangeStatisticsWorkModeInputBuilder

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();
}
Also used : ChangeStatisticsWorkModeInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) StatisticsContext(org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext) Test(org.junit.Test)

Example 3 with ChangeStatisticsWorkModeInputBuilder

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();
}
Also used : ChangeStatisticsWorkModeInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) StatisticsContext(org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 StatisticsContext (org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext)3 ChangeStatisticsWorkModeInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.ChangeStatisticsWorkModeInputBuilder)3 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)3