public static List<ComponentDef> getRootComponents(String configFile) throws ComponentException { if (componentsToLoad == null) { synchronized (ComponentLoaderConfig.class) { if (componentsToLoad == null) { if (configFile == null) { configFile = COMPONENT_LOAD_XML_FILENAME; } URL xmlUrl = UtilURL.fromResource(configFile); ComponentLoaderConfig.componentsToLoad = ComponentLoaderConfig.getComponentsFromConfig(xmlUrl); } } } return componentsToLoad; }
/* call run test suite from webtool selenium */ public static String runTestSuite(HttpServletRequest request, HttpServletResponse response) { Map parameters = UtilHttp.getParameterMap(request); String para = (String) parameters.get("testSuitePath"); if (para == null) { System.out.println("Error message : Test suite Path is null"); return "success"; } if (para.length() == 0) { System.out.println("Error message : Test suite Path is null"); return "success"; } try { URL url = UtilURL.fromResource("seleniumXml.properties"); if (props == null) { props = new Properties(); initConfig(url); } SeleniumXml sel = new SeleniumXml(); File testFile = new File(para.trim()); if (testFile.exists()) { System.err.println(" Argument : " + para.trim()); System.err.println(" Full absolute path of file : " + testFile.getAbsolutePath()); System.err.println(" Full canonical path of file : " + testFile.getCanonicalPath()); sel.testCaseDirectory = sel.getFileDirectory(testFile.getAbsolutePath()); System.err.println(" testCaseDirectory: " + sel.testCaseDirectory); sel.runTest(testFile.getAbsolutePath()); } else { System.err.println("Test File is not exist :" + para.trim()); } } catch (JDOMException jdome) { System.out.println(jdome.getMessage()); } catch (IOException ioe) { System.out.println("Error message : " + ioe.getMessage()); } finally { return "success"; } }