use of org.sakuli.services.forwarder.gearman.GearmanInitializingServiceImpl in project sakuli by ConSol.
the class InitializingServiceHelperTest method testInvokeAllResultServices.
@Test
public void testInvokeAllResultServices() throws Exception {
assertEquals(BeanLoader.loadMultipleBeans(InitializingService.class).size(), 3);
DatabaseInitializingServiceImpl databaseService = BeanLoader.loadBean(DatabaseInitializingServiceImpl.class);
doNothing().when(databaseService).initTestSuite();
GearmanInitializingServiceImpl gearmanService = BeanLoader.loadBean(GearmanInitializingServiceImpl.class);
doNothing().when(gearmanService).initTestSuite();
TestSuite testSuite = BeanLoader.loadBean(TestSuite.class);
testSuite.setState(null);
testSuite.setStartDate(null);
InitializingServiceHelper.invokeInitializingServcies();
assertEquals(testSuite.getState(), TestSuiteState.RUNNING);
assertTrue(testSuite.getStartDate().before(new DateTime().plusMillis(100).toDate()));
verify(databaseService).initTestSuite();
verify(gearmanService).initTestSuite();
}
Aggregations