org.testng.xml.XmlPackage Java Examples

The following examples show how to use org.testng.xml.XmlPackage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestStarter.java    From dockerfile-image-update with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * This will provide a test suite for TestNG which will be based on the package.
 * It delegates any class inspection / reflection to TestNG.
 *
 * @return the XmlSuite for com.salesforce.dockerfileimageupdate.itest.tests.*
 */
private List<XmlSuite> getXmlSuites() {
    XmlSuite suite = new XmlSuite();
    suite.setName("Full Integration Test");
    XmlTest test = new XmlTest(suite);
    test.setName("all-tests");
    XmlRun xmlRun = new XmlRun();
    xmlRun.onInclude(test.getName());
    List<XmlPackage> packages = new ArrayList<>();
    packages.add(new XmlPackage("com.salesforce.dockerfileimageupdate.itest.tests.*"));
    test.setXmlPackages(packages);
    List<XmlSuite> suites = new ArrayList<>();
    suites.add(suite);
    return suites;
}
 
Example #2
Source File: MyTestExecutor.java    From AppiumTestDistribution with GNU General Public License v3.0 5 votes vote down vote up
private static List<XmlPackage> getPackages() {
    List<XmlPackage> allPackages = new ArrayList<>();
    XmlPackage eachPackage = new XmlPackage();
    eachPackage.setName("output");
    allPackages.add(eachPackage);
    return allPackages;
}
 
Example #3
Source File: TestRunner.java    From qaf with MIT License 4 votes vote down vote up
private void init(IConfiguration configuration,
                  ISuite suite,
                  XmlTest test,
                  String outputDirectory,
                  IAnnotationFinder annotationFinder,
                  boolean skipFailedInvocationCounts,
                  Collection<IInvokedMethodListener> invokedMethodListeners,
                  List<IClassListener> classListeners)
{
  m_configuration = configuration;
  m_xmlTest= test;
  m_suite = suite;
  m_testName = test.getName();
  m_host = suite.getHost();
  m_testClassesFromXml= test.getXmlClasses();
  m_skipFailedInvocationCounts = skipFailedInvocationCounts;
  setVerbose(test.getVerbose());


  boolean preserveOrder = test.getPreserveOrder();
  m_methodInterceptors = new ArrayList<IMethodInterceptor>();
  builtinInterceptor = preserveOrder ? new PreserveOrderMethodInterceptor() : new InstanceOrderingMethodInterceptor();

  m_packageNamesFromXml= test.getXmlPackages();
  if(null != m_packageNamesFromXml) {
    for(XmlPackage xp: m_packageNamesFromXml) {
      m_testClassesFromXml.addAll(xp.getXmlClasses());
    }
  }

  m_annotationFinder= annotationFinder;
  m_invokedMethodListeners = invokedMethodListeners;
  m_classListeners.clear();
  for (IClassListener classListener : classListeners) {
    m_classListeners.put(classListener.getClass(), classListener);
  }
  m_invoker = new Invoker(m_configuration, this, this, m_suite.getSuiteState(),
      m_skipFailedInvocationCounts, invokedMethodListeners, classListeners);

  if (test.getParallel() != null) {
    log(3, "Running the tests in '" + test.getName() + "' with parallel mode:" + test.getParallel());
  }

  setOutputDirectory(outputDirectory);

  // Finish our initialization
  init();
}