Exemple #1
0
 public SeleniumXml() throws IOException {
   this.map = FastMap.newInstance();
   if (props == null) {
     props = new Properties();
     initConfig();
   }
   logger.setLevel(Level.DEBUG);
 }
Exemple #2
0
  /* 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";
    }
  }