Exemplo n.º 1
0
 public static void run(
     List suiteFiles,
     String testSourceDirectory,
     Map options,
     ArtifactVersion version,
     RunListener reportManager,
     TestNgTestSuite suite,
     File reportsDirectory)
     throws TestSetFailedException {
   TestNG testng = new TestNG(true);
   Configurator configurator = getConfigurator(version);
   configurator.configure(testng, options);
   postConfigure(testng, testSourceDirectory, reportManager, suite, reportsDirectory);
   testng.setTestSuites(suiteFiles);
   testng.run();
 }
Exemplo n.º 2
0
  public static void run(
      Class[] testClasses,
      String testSourceDirectory,
      Map options,
      ArtifactVersion version,
      RunListener reportManager,
      TestNgTestSuite suite,
      File reportsDirectory,
      final String methodNamePattern)
      throws TestSetFailedException {
    TestNG testng = new TestNG(true);

    applyGroupMatching(testng, options);
    if (!StringUtils.isBlank(methodNamePattern)) {
      applyMethodNameFiltering(testng, methodNamePattern);
    }

    Configurator configurator = getConfigurator(version);
    System.out.println("Configuring TestNG with: " + configurator);
    configurator.configure(testng, options);
    postConfigure(testng, testSourceDirectory, reportManager, suite, reportsDirectory);
    testng.setTestClasses(testClasses);
    testng.run();
  }