@Test(expectedExceptions = SakuliInitException.class, expectedExceptionsMessageRegExp = "Error - java.io.FileNotFoundException.* - during reading in testsuite.suite file 'unvalid-testsuite.suite'") public void testUnvalidTestSuiteFile() throws Exception { when(testSuiteMock.getAbsolutePathOfTestSuiteFile()).thenReturn(Paths.get("unvalid-testsuite.suite").toString()); testling.checkTestSuiteFile(); }
void checkTestSuiteFile() throws SakuliInitException { try { Utils.readFileAsString(testSuite.getAbsolutePathOfTestSuiteFile()); } catch (Exception e) { throw new SakuliInitException(e, String.format("Error - %s - during reading in testsuite.suite file '%s'", (e instanceof NullPointerException) ? "unable to read or locate file" : e.getMessage(), testSuite.getAbsolutePathOfTestSuiteFile())); } }
SahiConnector { void checkTestSuiteFile() throws SakuliInitException { try { Utils.readFileAsString(testSuite.getAbsolutePathOfTestSuiteFile()); } catch (Exception e) { throw new SakuliInitException(e, String.format("Error - %s - during reading in testsuite.suite file '%s'", (e instanceof NullPointerException) ? "unable to read or locate file" : e.getMessage(), testSuite.getAbsolutePathOfTestSuiteFile())); } } }
SahiConnector { void checkTestSuiteFile() throws SakuliInitException { try { Utils.readFileAsString(testSuite.getAbsolutePathOfTestSuiteFile()); } catch (Exception e) { throw new SakuliInitException(e, String.format("Error - %s - during reading in testsuite.suite file '%s'", (e instanceof NullPointerException) ? "unable to read or locate file" : e.getMessage(), testSuite.getAbsolutePathOfTestSuiteFile())); } }  }
SahiConnector { void checkTestSuiteFile() throws SakuliInitException { try { Utils.readFileAsString(testSuite.getAbsolutePathOfTestSuiteFile()); } catch (Exception e) { throw new SakuliInitException(e, String.format("Error - %s - during reading in testsuite.suite file '%s'", (e instanceof NullPointerException) ? "unable to read or locate file" : e.getMessage(), testSuite.getAbsolutePathOfTestSuiteFile())); } }  void init(); void startSahiTestSuite(); }
SahiConnector { void checkTestSuiteFile() throws SakuliInitException { try { Utils.readFileAsString(testSuite.getAbsolutePathOfTestSuiteFile()); } catch (Exception e) { throw new SakuliInitException(e, String.format("Error - %s - during reading in testsuite.suite file '%s'", (e instanceof NullPointerException) ? "unable to read or locate file" : e.getMessage(), testSuite.getAbsolutePathOfTestSuiteFile())); } }  void init(); void startSahiTestSuite();  }