@Test public void testInitWithOutTestCases() throws Exception { TestSuiteProperties props = new TestSuiteProperties(); props.setTestSuiteId("suite_id"); props.setLoadTestCasesAutomatic(false); testSuiteProperties = spy(props); ts = spy(new TestSuite(testSuiteProperties)); MockitoAnnotations.initMocks(this); testling.initTestSuite(); assertEquals(ts.getState(), TestSuiteState.RUNNING); assertNotNull(ts.getStartDate()); assertNull(ts.getAbsolutePathOfTestSuiteFile()); assertEquals(ts.getDbPrimaryKey(), -1); assertNull(ts.getTestCases()); assertEquals(ts.getId(), "suite_id"); }
@Override public void initTestSuite() throws SakuliInitException { checkConfiguration(testSuite); logger.info("initialize test suite with id '{}'", testSuite.getId()); testSuite.clearException(); testSuite.setState(TestSuiteState.RUNNING); testSuite.setStartDate(new Date()); testSuite.setStopDate(null); try { testSuite.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { testSuite.setHost("UNKNOWN HOST"); } if (testSuiteProperties.isLoadTestCasesAutomatic()) { try { testSuite.setTestCases(null); testSuite.setTestCases(TestSuiteHelper.loadTestCases(testSuiteProperties)); } catch (IOException e) { throw new SakuliInitException(e, String.format("Cannot read testsuite.suite '%s' file", testSuiteProperties.getTestSuiteSuiteFile().toString())); } } logger.info("test suite with guid '{}' has been initialized!", testSuite.getGuid()); logger.debug("test suite data after initialization: {}", testSuite.toString()); }
CommonInitializingServiceImpl implements InitializingService { @Override public void initTestSuite() throws SakuliInitException { checkConfiguration(testSuite); logger.info("initialize test suite with id '{}'", testSuite.getId()); testSuite.clearException(); testSuite.setState(TestSuiteState.RUNNING); testSuite.setStartDate(new Date()); testSuite.setStopDate(null); try { testSuite.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { testSuite.setHost("UNKNOWN HOST"); } if (testSuiteProperties.isLoadTestCasesAutomatic()) { try { testSuite.setTestCases(null); testSuite.setTestCases(TestSuiteHelper.loadTestCases(testSuiteProperties)); } catch (IOException e) { throw new SakuliInitException(e, String.format("Cannot read testsuite.suite '%s' file", testSuiteProperties.getTestSuiteSuiteFile().toString())); } } logger.info("test suite with guid '{}' has been initialized!", testSuite.getGuid()); logger.debug("test suite data after initialization: {}", testSuite.toString()); } }
CommonInitializingServiceImpl implements InitializingService { @Override public void initTestSuite() throws SakuliInitException { checkConfiguration(testSuite); logger.info("initialize test suite with id '{}'", testSuite.getId()); testSuite.clearException(); testSuite.setState(TestSuiteState.RUNNING); testSuite.setStartDate(new Date()); testSuite.setStopDate(null); try { testSuite.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { testSuite.setHost("UNKNOWN HOST"); } if (testSuiteProperties.isLoadTestCasesAutomatic()) { try { testSuite.setTestCases(null); testSuite.setTestCases(TestSuiteHelper.loadTestCases(testSuiteProperties)); } catch (IOException e) { throw new SakuliInitException(e, String.format("Cannot read testsuite.suite '%s' file", testSuiteProperties.getTestSuiteSuiteFile().toString())); } } logger.info("test suite with guid '{}' has been initialized!", testSuite.getGuid()); logger.debug("test suite data after initialization: {}", testSuite.toString()); }  }
CommonInitializingServiceImpl implements InitializingService { @Override public void initTestSuite() throws SakuliInitException { checkConfiguration(testSuite); logger.info("initialize test suite with id '{}'", testSuite.getId()); testSuite.clearException(); testSuite.setState(TestSuiteState.RUNNING); testSuite.setStartDate(new Date()); testSuite.setStopDate(null); try { testSuite.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { testSuite.setHost("UNKNOWN HOST"); } if (testSuiteProperties.isLoadTestCasesAutomatic()) { try { testSuite.setTestCases(null); testSuite.setTestCases(TestSuiteHelper.loadTestCases(testSuiteProperties)); } catch (IOException e) { throw new SakuliInitException(e, String.format("Cannot read testsuite.suite '%s' file", testSuiteProperties.getTestSuiteSuiteFile().toString())); } } logger.info("test suite with guid '{}' has been initialized!", testSuite.getGuid()); logger.debug("test suite data after initialization: {}", testSuite.toString()); }  @Override int getServicePriority(); @Override void initTestSuite(); }
CommonInitializingServiceImpl implements InitializingService { @Override public void initTestSuite() throws SakuliInitException { checkConfiguration(testSuite); logger.info("initialize test suite with id '{}'", testSuite.getId()); testSuite.clearException(); testSuite.setState(TestSuiteState.RUNNING); testSuite.setStartDate(new Date()); testSuite.setStopDate(null); try { testSuite.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { testSuite.setHost("UNKNOWN HOST"); } if (testSuiteProperties.isLoadTestCasesAutomatic()) { try { testSuite.setTestCases(null); testSuite.setTestCases(TestSuiteHelper.loadTestCases(testSuiteProperties)); } catch (IOException e) { throw new SakuliInitException(e, String.format("Cannot read testsuite.suite '%s' file", testSuiteProperties.getTestSuiteSuiteFile().toString())); } } logger.info("test suite with guid '{}' has been initialized!", testSuite.getGuid()); logger.debug("test suite data after initialization: {}", testSuite.toString()); }  @Override int getServicePriority(); @Override void initTestSuite();  }