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();
}
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;
}
Aggregations