コード例 #1
0
  /**
   * The entry point of the test execution from HP ALM/QC <br>
   * Exits with a value of 0 if the test passes and 1 if the test fails
   *
   * @param args Command line arguments to control the test parameters (details below):<br>
   *     <b>Argument 1 :</b> The absolute path where the test report is to be stored (Mandatory)<br>
   *     <b>Argument 2 :</b> The name of the scenario which contains the test case to be executed
   *     (Mandatory)<br>
   *     <b>Argument 3 :</b> The name of the test case to be executed (Mandatory)<br>
   *     <b>Argument 4 :</b> The description of the test case to be executed (Optional - Specify
   *     SKIP if not required)<br>
   *     <b>Argument 5 :</b> The iteration mode - RunAllIterations, RunOneIterationOnly or
   *     RunRangeOfIterations (Optional - Specify SKIP if not required)<br>
   *     <b>Argument 6 :</b> The start iteration - applicable only for RunRangeOfIterations
   *     (Optional - Specify SKIP if not required)<br>
   *     <b>Argument 7 :</b> The end iteration - applicable only for RunRangeOfIterations (Optional
   *     - Specify SKIP if not required)<br>
   *     <b>Argument 8 :</b> The browser on which the test is to be executed (Optional - Specify
   *     SKIP if not required)<br>
   *     <b>Argument 9 :</b> The browser version (Optional - Specify SKIP if not required)<br>
   *     <b>Argument 10 :</b> The platform on which the test is to be executed (Optional - Specify
   *     SKIP if not required)
   */
  public static void main(String[] args) {
    if (args.length < 3) {
      System.out.println(
          "\nError: Insufficient parameters!"
              + "\nUsage: java allocator.QcTestRunner "
              + "<report-path> "
              + "<scenario-name> <test-name> <test-description*> "
              + "<iteration-mode*> <start-iteration*> <end-iteration*> "
              + "<browser*> <browser-version*> <platform*> "
              + "\n\n * - Optional (specify SKIP if not required)");
      return;
    }

    setRelativePath();
    initializeTestParameters(args);

    String testStatus = driveExecutionFromQc();
    if (testStatus == "Passed") {
      System.exit(0);
    } else {
      System.exit(1);
    }
  }