@Test public void testCheckTestSuiteFolderAndSetContextVariables() throws Exception { final String absoluteTestSuitePath = Paths.get(TEST_FOLDER_PATH).toAbsolutePath().toString(); String log = ""; log = SakuliFolderHelper.checkTestSuiteFolderAndSetContextVariables(TEST_FOLDER_PATH, log); assertEquals(SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE, absoluteTestSuitePath); assertEquals(log, "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + absoluteTestSuitePath + "\""); }
public static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache) throws FileNotFoundException { Path testSuiteFolder = normalizePath(testSuiteFolderPath); Path propertyFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_APPENDER); Path suiteFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER); if (testSuiteFolder == null || !Files.exists(testSuiteFolder)) { throw new FileNotFoundException("sakuli test suite folder \"" + testSuiteFolderPath + "\" does not exist!"); } else if (!Files.exists(propertyFile)) { throw new FileNotFoundException("property file \"" + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } else if (!Files.exists(suiteFile)) { throw new FileNotFoundException("suite file \"" + TestSuiteProperties.TEST_SUITE_SUITE_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE = testSuiteFolder.toAbsolutePath().toString(); return tempLogCache + "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE + "\""; }
SakuliFolderHelper { public static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache) throws FileNotFoundException { Path testSuiteFolder = normalizePath(testSuiteFolderPath); Path propertyFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_APPENDER); Path suiteFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER); if (testSuiteFolder == null || !Files.exists(testSuiteFolder)) { throw new FileNotFoundException("sakuli test suite folder \"" + testSuiteFolderPath + "\" does not exist!"); } else if (!Files.exists(propertyFile)) { throw new FileNotFoundException("property file \"" + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } else if (!Files.exists(suiteFile)) { throw new FileNotFoundException("suite file \"" + TestSuiteProperties.TEST_SUITE_SUITE_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE = testSuiteFolder.toAbsolutePath().toString(); return tempLogCache + "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE + "\""; } }
SakuliFolderHelper { public static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache) throws FileNotFoundException { Path testSuiteFolder = normalizePath(testSuiteFolderPath); Path propertyFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_APPENDER); Path suiteFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER); if (testSuiteFolder == null || !Files.exists(testSuiteFolder)) { throw new FileNotFoundException("sakuli test suite folder \"" + testSuiteFolderPath + "\" does not exist!"); } else if (!Files.exists(propertyFile)) { throw new FileNotFoundException("property file \"" + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } else if (!Files.exists(suiteFile)) { throw new FileNotFoundException("suite file \"" + TestSuiteProperties.TEST_SUITE_SUITE_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE = testSuiteFolder.toAbsolutePath().toString(); return tempLogCache + "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE + "\""; }  }
SakuliFolderHelper { public static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache) throws FileNotFoundException { Path testSuiteFolder = normalizePath(testSuiteFolderPath); Path propertyFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_APPENDER); Path suiteFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER); if (testSuiteFolder == null || !Files.exists(testSuiteFolder)) { throw new FileNotFoundException("sakuli test suite folder \"" + testSuiteFolderPath + "\" does not exist!"); } else if (!Files.exists(propertyFile)) { throw new FileNotFoundException("property file \"" + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } else if (!Files.exists(suiteFile)) { throw new FileNotFoundException("suite file \"" + TestSuiteProperties.TEST_SUITE_SUITE_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE = testSuiteFolder.toAbsolutePath().toString(); return tempLogCache + "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE + "\""; }  static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache); static Path normalizePath(String path); static String checkSakuliHomeFolderAndSetContextVariables(String sakuliMainFolderPath, String tempLogCache); static String checkSahiProxyHomeAndSetContextVariables(String sahiProxyHomePath, String tempLogCache); static String setTestSuiteBrowserContextVariable(String testSuiteBrowserName, String tempLogCache); }
SakuliFolderHelper { public static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache) throws FileNotFoundException { Path testSuiteFolder = normalizePath(testSuiteFolderPath); Path propertyFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_APPENDER); Path suiteFile = Paths.get(testSuiteFolder + TestSuiteProperties.TEST_SUITE_SUITE_FILE_APPENDER); if (testSuiteFolder == null || !Files.exists(testSuiteFolder)) { throw new FileNotFoundException("sakuli test suite folder \"" + testSuiteFolderPath + "\" does not exist!"); } else if (!Files.exists(propertyFile)) { throw new FileNotFoundException("property file \"" + TestSuiteProperties.TEST_SUITE_PROPERTIES_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } else if (!Files.exists(suiteFile)) { throw new FileNotFoundException("suite file \"" + TestSuiteProperties.TEST_SUITE_SUITE_FILE_NAME + "\" does not exist in folder: " + testSuiteFolderPath); } SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE = testSuiteFolder.toAbsolutePath().toString(); return tempLogCache + "\nset property '" + TestSuiteProperties.TEST_SUITE_FOLDER + "' to \"" + SakuliPropertyPlaceholderConfigurer.TEST_SUITE_FOLDER_VALUE + "\""; }  static String checkTestSuiteFolderAndSetContextVariables(String testSuiteFolderPath, String tempLogCache); static Path normalizePath(String path); static String checkSakuliHomeFolderAndSetContextVariables(String sakuliMainFolderPath, String tempLogCache); static String checkSahiProxyHomeAndSetContextVariables(String sahiProxyHomePath, String tempLogCache); static String setTestSuiteBrowserContextVariable(String testSuiteBrowserName, String tempLogCache);  }