Search in sources :

Example 1 with LogCleanUpResultServiceImpl

use of org.sakuli.services.common.LogCleanUpResultServiceImpl in project sakuli by ConSol.

the class TeardownServiceHelperTest method testInvokeAllTeardwonServices.

@Test
public void testInvokeAllTeardwonServices() throws Exception {
    assertEquals(BeanLoader.loadMultipleBeans(TeardownService.class).size(), 5);
    DatabaseResultServiceImpl databaseResultService = mockDatabaseResultService();
    GearmanResultServiceImpl gearmanResultService = mockGearmanResultService();
    CacheHandlingResultServiceImpl cacheHandlingResultService = mockCacheHandlingResultService();
    LogCleanUpResultServiceImpl logCleanUpResultService = mockLogCleanUpResultService();
    TestSuite testSuite = BeanLoader.loadBean(TestSuite.class);
    testSuite.setState(TestSuiteState.RUNNING);
    TeardownServiceHelper.invokeTeardownServices();
    assertEquals(testSuite.getState(), TestSuiteState.OK);
    assertTrue(testSuite.getStopDate().after(testSuite.getStartDate()));
    verify(databaseResultService).saveAllResults();
    verify(databaseResultService).refreshStates();
    verify(gearmanResultService).saveAllResults();
    verify(gearmanResultService).refreshStates();
    verify(cacheHandlingResultService).saveAllResults();
    verify(cacheHandlingResultService).refreshStates();
    verify(logCleanUpResultService).triggerAction();
}
Also used : GearmanResultServiceImpl(org.sakuli.services.forwarder.gearman.GearmanResultServiceImpl) CacheHandlingResultServiceImpl(org.sakuli.services.common.CacheHandlingResultServiceImpl) TestSuite(org.sakuli.datamodel.TestSuite) DatabaseResultServiceImpl(org.sakuli.services.forwarder.database.DatabaseResultServiceImpl) LogCleanUpResultServiceImpl(org.sakuli.services.common.LogCleanUpResultServiceImpl) Test(org.testng.annotations.Test)

Example 2 with LogCleanUpResultServiceImpl

use of org.sakuli.services.common.LogCleanUpResultServiceImpl in project sakuli by ConSol.

the class TeardownServiceHelperTest method mockLogCleanUpResultService.

private LogCleanUpResultServiceImpl mockLogCleanUpResultService() {
    LogCleanUpResultServiceImpl logCleanUpResultService = BeanLoader.loadBean(LogCleanUpResultServiceImpl.class);
    doNothing().when(logCleanUpResultService).triggerAction();
    return logCleanUpResultService;
}
Also used : LogCleanUpResultServiceImpl(org.sakuli.services.common.LogCleanUpResultServiceImpl)

Aggregations

LogCleanUpResultServiceImpl (org.sakuli.services.common.LogCleanUpResultServiceImpl)2 TestSuite (org.sakuli.datamodel.TestSuite)1 CacheHandlingResultServiceImpl (org.sakuli.services.common.CacheHandlingResultServiceImpl)1 DatabaseResultServiceImpl (org.sakuli.services.forwarder.database.DatabaseResultServiceImpl)1 GearmanResultServiceImpl (org.sakuli.services.forwarder.gearman.GearmanResultServiceImpl)1 Test (org.testng.annotations.Test)1