Class TestNgOperation


@NullMarked public class TestNgOperation extends TestOperation<TestNgOperation,List<String>>
Run tests with TestNG.
Since:
1.0
Author:
Erik C. Thauvin
  • Constructor Details

    • TestNgOperation

      public TestNgOperation()
  • Method Details

    • execute

      public void execute() throws IOException, InterruptedException, ExitStatusException
      Performs the operation.
      Overrides:
      execute in class AbstractProcessOperation<TestNgOperation>
      Throws:
      NullPointerException - if the project is null
      IllegalArgumentException - if at least one of XML suite, package, method, test class, or test name is not specified
      IOException
      InterruptedException
      ExitStatusException
    • executeConstructProcessCommandList

      protected List<String> executeConstructProcessCommandList()
      Part of the execute operation, constructs the command list to use for building the process.
      Overrides:
      executeConstructProcessCommandList in class TestOperation<TestNgOperation,List<String>>
      Returns:
      the command list
    • fromProject

      public TestNgOperation fromProject(BaseProject project)
      Configures the BaseProject.

      Sets the report directory to the project build directory if not already set.

      Overrides:
      fromProject in class TestOperation<TestNgOperation,List<String>>
      Parameters:
      project - the project
      Returns:
      this operation instance
      Throws:
      NullPointerException - if project is null
    • alwaysRunListeners

      public TestNgOperation alwaysRunListeners(boolean isAlwaysRunListeners)
      Should Method Invocation Listeners be run even for skipped methods.

      Default is true

      Parameters:
      isAlwaysRunListeners - true or false
      Returns:
      this operation instance
    • dataProviderThreadCount

      public TestNgOperation dataProviderThreadCount(int count)
      This sets the default maximum number of threads to use for data providers when running tests in parallel.

      It will only take effect if the parallel mode has been selected (for example, with the parallel option). This can be overridden in the suite definition.

      Parameters:
      count - the count
      Returns:
      this operation instance
      Throws:
      IllegalArgumentException - if count is negative
    • dependencyInjectorFactory

      public TestNgOperation dependencyInjectorFactory(String injectorFactory)
      The dependency injector factory implementation that TestNG should use.
      Parameters:
      injectorFactory - the injector factory
      Returns:
      this operation instance
      Throws:
      NullPointerException - if injectorFactory is null
      IllegalArgumentException - if injectorFactory is blank
    • directory

      public TestNgOperation directory(String directoryPath)
      The directory where the reports will be generated

      Default is build/test-output)

      Parameters:
      directoryPath - the directory path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directoryPath is null
      IllegalArgumentException - if directoryPath is blank
    • directory

      public TestNgOperation directory(File directoryPath)
      The directory where the reports will be generated

      Default is build/test-output)

      Parameters:
      directoryPath - the directory path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directoryPath is null
    • directory

      public TestNgOperation directory(Path directoryPath)
      The directory where the reports will be generated

      Default is build/test-output)

      Parameters:
      directoryPath - the directory path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directoryPath is null
    • excludeGroups

      public Set<String> excludeGroups()
      Returns the list of groups to exclude from this run.
      Returns:
      the set of groups
    • excludeGroups

      public TestNgOperation excludeGroups(String... groups)
      The list of groups you want to be excluded from this run.
      Parameters:
      groups - one or more groups
      Returns:
      this operation instance
      Throws:
      NullPointerException - if groups is null or contains null elements
      IllegalArgumentException - if groups is empty or contains blank elements
      See Also:
    • excludeGroups

      public TestNgOperation excludeGroups(Collection<String> groups)
      The list of groups you want to be excluded from this run.
      Parameters:
      groups - the list of groups
      Returns:
      this operation instance
      Throws:
      NullPointerException - if groups is null or contains null elements
      IllegalArgumentException - if groups is empty or contains blank elements
      See Also:
    • failWhenEverythingSkipped

      public TestNgOperation failWhenEverythingSkipped(boolean isFailAllSkipped)
      Should TestNG fail execution if all tests were skipped and nothing was run.
      Parameters:
      isFailAllSkipped - true or false
      Returns:
      this operation instance
    • failurePolicy

      public TestNgOperation failurePolicy(TestNgOperation.FailurePolicy policy)
      Whether TestNG should continue to execute the remaining tests in the suite or skip them if in a @Before* method.
      Parameters:
      policy - the policy
      Returns:
      this operation instance
      Throws:
      NullPointerException - if policy is null
    • generateResultsPerSuite

      public TestNgOperation generateResultsPerSuite(boolean resultsPerSuite)
      Should TestNG generate results on a per-suite basis by creating a subdirectory for each suite and dumping results into it.

      Default is false

      .
      Parameters:
      resultsPerSuite - true or false
      Returns:
      this operation instance
    • groups

      public Set<String> groups()
      Returns the list of groups to run.
      Returns:
      the set of groups
    • groups

      public TestNgOperation groups(String... groups)
      The list of groups you want to run.

      For example: "windows", "linux", "regression

      Parameters:
      groups - one or more groups
      Returns:
      this operation instance
      Throws:
      NullPointerException - if groups is null or contains null elements
      IllegalArgumentException - if groups is empty or contains blank elements
      See Also:
    • groups

      public TestNgOperation groups(Collection<String> groups)
      The list of groups you want to run.

      For example: "windows", "linux", "regression

      Parameters:
      groups - the list of groups
      Returns:
      this operation instance
      Throws:
      NullPointerException - if groups is null or contains null elements
      IllegalArgumentException - if groups is empty or contains blank elements
      See Also:
    • ignoreMissedTestName

      public TestNgOperation ignoreMissedTestName(boolean isIgnoreMissedTestNames)
      Ignore missed test names given by testNames and continue to run existing tests, if any.

      Default is false

      Parameters:
      isIgnoreMissedTestNames - true or false
      Returns:
      this operation instance
    • includeAllDataDrivenTestsWhenSkipping

      public TestNgOperation includeAllDataDrivenTestsWhenSkipping(boolean isIncludeDrivenTestsWhenSkipping)
      Should TestNG report all iterations of a data driven test as individual skips, in-case of upstream failures.

      Default is false

      Parameters:
      isIncludeDrivenTestsWhenSkipping - true or false
      Returns:
      this operation instance
    • jUnit

      public TestNgOperation jUnit(boolean isJunit)
      Enables or disables the JUnit mode.

      Default is false

      Parameters:
      isJunit - true or false
      Returns:
      this operation instance
    • listener

      public TestNgOperation listener(String... listeners)
      The list of .class files or list of class names implementing ITestListener or ISuiteListener
      Parameters:
      listeners - one or more listeners
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listeners is null or contains null elements
      IllegalArgumentException - if listeners is empty or contains blank elements
      See Also:
    • listener

      public TestNgOperation listener(Collection<String> listeners)
      The list of .class files or list of class names implementing ITestListener or ISuiteListener
      Parameters:
      listeners - the list of listeners
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listeners is null or contains null elements
      IllegalArgumentException - if listeners is empty or contains blank elements
      See Also:
    • listenerComparator

      public TestNgOperation listenerComparator(String listenerComparator)
      An implementation of ListenerComparator that will be used by TestNG to determine order of execution for listeners.
      Parameters:
      listenerComparator - the listener comparator
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listenerComparator is null
      IllegalArgumentException - if listenerComparator is blank
    • listenerFactory

      public TestNgOperation listenerFactory(String listenerFactory)
      The factory used to create TestNG listeners.
      Parameters:
      listenerFactory - the listener factory
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listenerFactory is null
      IllegalArgumentException - if listenerFactory is blank
    • log

      public TestNgOperation log(int level)
      Set the level of verbosity.
      Parameters:
      level - the level
      Returns:
      this operation instance
      Throws:
      IllegalArgumentException - if level is negative
      See Also:
    • methodSelectors

      public TestNgOperation methodSelectors(String... selectors)
      Specifies the list of .class files or class names implementing IMethodSelector.

      For example: "com.example.Selector1:3", "com.example.Selector2:2"

      Parameters:
      selectors - one or more selectors
      Returns:
      this operation instance
      Throws:
      NullPointerException - if selectors is null or contains null elements
      IllegalArgumentException - if selectors is empty or contains blank elements
      See Also:
    • methodSelectors

      public TestNgOperation methodSelectors(Collection<String> selectors)
      Specifies the list of .class files or class names implementing IMethodSelector.

      For example: "com.example.Selector1:3", "com.example.Selector2:2"

      Parameters:
      selectors - the list of selectors
      Returns:
      this operation instance
      Throws:
      NullPointerException - if selectors is null or contains null elements
      IllegalArgumentException - if selectors is empty or contains blank elements
      See Also:
    • methods

      public TestNgOperation methods(String... methods)
      Lets you specify individual methods to run.

      For example: "com.example.Foo.f1", "com.example.Bar.f2"

      Parameters:
      methods - one or more methods
      Returns:
      this operation instance
      Throws:
      NullPointerException - if methods is null or contains null elements
      IllegalArgumentException - if methods is empty or contains blank elements
      See Also:
    • methods

      public TestNgOperation methods(Collection<String> methods)
      Lets you specify individual methods to run.

      For example: "com.example.Foo.f1", "com.example.Bar.f2"

      Parameters:
      methods - the list of methods
      Returns:
      this operation instance
      Throws:
      NullPointerException - if methods is null or contains null elements
      IllegalArgumentException - if methods is empty or contains blank elements
      See Also:
    • methods

      public Set<String> methods()
      Returns the methods to run.
      Returns:
      the set of methods
    • mixed

      public TestNgOperation mixed(boolean isMixed)
      Mixed mode autodetects the type of current test and run it with appropriate runner.

      Default is false

      Parameters:
      isMixed - true or false
      Returns:
      this operation instance
    • objectFactory

      public TestNgOperation objectFactory(String... factories)
      The list of .class files or class names implementing ITestRunnerFactory.

      A fully qualified class name that implements org.testng.ITestObjectFactory which can be used to create test class and listener instances.

      Parameters:
      factories - one or more factory
      Returns:
      this operation instance
      Throws:
      NullPointerException - if factories is null or contains null elements
      IllegalArgumentException - if factories is empty or contains blank elements
      See Also:
    • objectFactory

      public TestNgOperation objectFactory(Collection<String> factories)
      The list of .class files or class names implementing ITestRunnerFactory.

      A fully qualified class name that implements org.testng.ITestObjectFactory which can be used to create test class and listener instances.

      Parameters:
      factories - the list of factories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if factories is null or contains null elements
      IllegalArgumentException - if factories is empty or contains blank elements
      See Also:
    • options

      public Map<String,String> options()
      Returns the run options.
      Returns:
      the map of run options
    • overrideIncludedMethods

      public TestNgOperation overrideIncludedMethods(String... methods)
      The list of fully qualified class names of listeners that should be skipped from being wired in via Service Loaders.
      Parameters:
      methods - one or more methods
      Returns:
      this operation instance
      Throws:
      NullPointerException - if methods is null or contains null elements
      IllegalArgumentException - if methods is empty or contains blank elements
      See Also:
    • overrideIncludedMethods

      public TestNgOperation overrideIncludedMethods(Collection<String> methods)
      The list of fully qualified class names of listeners that should be skipped from being wired in via Service Loaders.
      Parameters:
      methods - the list of methods
      Returns:
      this operation instance
      Throws:
      NullPointerException - if methods is null or contains null elements
      IllegalArgumentException - if methods is empty or contains blank elements
      See Also:
    • packages

      public TestNgOperation packages(String... names)
      The list of packages to include in this test. If the package name ends with .* then subpackages are included too. Required if no suites(String...suites) specified.

      For example: "com.example", "test.sample.*"

      Parameters:
      names - one or more names
      Returns:
      this operation instance
      Throws:
      NullPointerException - if names is null or contains null elements
      IllegalArgumentException - if names is empty or contains blank elements
      See Also:
    • packages

      public TestNgOperation packages(Collection<String> names)
      The list of packages to include in this test. If the package name ends with .* then subpackages are included too. Required if no suites(String...suites) specified.

      For example: "com.example", "test.sample.*"

      Parameters:
      names - the list of names
      Returns:
      this operation instance
      Throws:
      NullPointerException - if names is null or contains null elements
      IllegalArgumentException - if names is empty or contains blank elements
      See Also:
    • packages

      public Set<String> packages()
      Returns the suite packages to run.
      Returns:
      the set of packages
    • parallel

      public TestNgOperation parallel(TestNgOperation.Parallel mechanism)
      If specified, sets the default mechanism used to determine how to use parallel threads when running tests. If not set, default mechanism is not to use parallel threads at all. This can be overridden in the suite definition.
      Parameters:
      mechanism - the mechanism
      Returns:
      this operation instance
      Throws:
      NullPointerException - if mechanism is null
      See Also:
    • propagateDataProviderFailureAsTestFailure

      public TestNgOperation propagateDataProviderFailureAsTestFailure(boolean isPropagateDataProviderFailure)
      Should TestNG consider failures in Data Providers as test failures.

      Default is false

      Parameters:
      isPropagateDataProviderFailure - true or false
      Returns:
      this operation instance
    • reporter

      public TestNgOperation reporter(String reporter)
      Specifies the extended configuration for custom report listener.
      Parameters:
      reporter - the reporter
      Returns:
      this operation instance
      Throws:
      NullPointerException - if reporter is null
      IllegalArgumentException - if reporter is blank
    • shareThreadPoolForDataProviders

      public TestNgOperation shareThreadPoolForDataProviders(boolean shareThreadPoolForDataProviders)
      Should TestNG use a global Shared ThreadPool (At suite level) for running data providers.
      Parameters:
      shareThreadPoolForDataProviders - true or false
      Returns:
      this operation instance
    • sourceDir

      public TestNgOperation sourceDir(String... directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - one or more directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty or contains blank elements
      See Also:
    • sourceDir

      public TestNgOperation sourceDir(File... directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - one or more directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty
      See Also:
    • sourceDir

      public TestNgOperation sourceDir(Path... directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - one or more directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty
      See Also:
    • sourceDir

      public TestNgOperation sourceDir(Collection<String> directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - the list of directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty or contains blank elements
      See Also:
    • sourceDirFiles

      public TestNgOperation sourceDirFiles(Collection<File> directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - the list of directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty
      See Also:
    • sourceDirPaths

      public TestNgOperation sourceDirPaths(Collection<Path> directories)
      The directories where your Javadoc annotated test sources are. This option is only necessary if you are using Javadoc type annotations. (e.g. "src/test" or "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng").
      Parameters:
      directories - the list of directories
      Returns:
      this operation instance
      Throws:
      NullPointerException - if directories is null or contains null elements
      IllegalArgumentException - if directories is empty
      See Also:
    • spiListenersToSkip

      public TestNgOperation spiListenersToSkip(String... listeners)
      Specifies the List of fully qualified class names of listeners that should be skipped from being wired in via Service Loaders.
      Parameters:
      listeners - the listeners to skip
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listeners is null or contains null elements
      IllegalArgumentException - if listeners is empty or contains blank elements
      See Also:
    • spiListenersToSkip

      public TestNgOperation spiListenersToSkip(Collection<String> listeners)
      Specifies the List of fully qualified class names of listeners that should be skipped from being wired in via Service Loaders.
      Parameters:
      listeners - the listeners to skip
      Returns:
      this operation instance
      Throws:
      NullPointerException - if listeners is null or contains null elements
      IllegalArgumentException - if listeners is empty or contains blank elements
      See Also:
    • suiteName

      public TestNgOperation suiteName(String name)
      This specifies the default name of the test suite, if not specified in the suite definition file or source code.

      This option is ignored if the suite.xml file or the source code specifies a different suite name.

      Parameters:
      name - the name
      Returns:
      this operation instance
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name is blank
    • suiteThreadPoolSize

      public TestNgOperation suiteThreadPoolSize(int poolSize)
      Specifies the size of the thread pool to use to run suites.

      Required if no packages(String...) specified.

      Parameters:
      poolSize - the pool size
      Returns:
      this operation instance
      Throws:
      IllegalArgumentException - if poolSize is negative
    • suites

      public TestNgOperation suites(String... suites)
      Specifies the suites to run.

      For example: "testng.xml", "testng2.xml"

      Parameters:
      suites - one or more suites
      Returns:
      this operation instance
      Throws:
      NullPointerException - if suites is null or contains null elements
      IllegalArgumentException - if suites is empty or contains blank elements
      See Also:
    • suites

      public TestNgOperation suites(Collection<String> suites)
      Specifies the suites to run.

      For example: "testng.xml", "testng2.xml"

      Parameters:
      suites - the list of suites
      Returns:
      this operation instance
      Throws:
      NullPointerException - if suites is null or contains null elements
      IllegalArgumentException - if suites is empty or contains blank elements
      See Also:
    • suites

      public Set<String> suites()
      Returns the suites to run.
      Returns:
      the set of suites
    • testClass

      public TestNgOperation testClass(String... classes)
      Specifies the list of class files.

      For example: "org.foo.Test1","org.foo.test2"

      Parameters:
      classes - one or more classes
      Returns:
      this operation instance
      Throws:
      NullPointerException - if classes is null or contains null elements
      IllegalArgumentException - if classes is empty or contains blank elements
      See Also:
    • testClass

      public TestNgOperation testClass(Collection<String> classes)
      Specifies the list of class files.

      For example: "org.foo.Test1","org.foo.test2"

      Parameters:
      classes - the list of classes
      Returns:
      this operation instance
      Throws:
      NullPointerException - if classes is null or contains null elements
      IllegalArgumentException - if classes is empty or contains blank elements
      See Also:
    • testClasses

      public Set<String> testClasses()
      Returns the test classes to run.
      Returns:
      the set of test classes
    • testClasspath

      public TestNgOperation testClasspath(String... entries)
      Specifies the classpath entries used to run tests.

      Replaces default classpath. Include the build main and test directories compiled classes are needed.

      Parameters:
      entries - one or more entries
      Returns:
      this operation instance
      Throws:
      NullPointerException - if entries is null or contains null elements
      IllegalArgumentException - if entries is empty or contains blank elements
      See Also:
    • testClasspath

      public TestNgOperation testClasspath(Collection<String> entries)
      Specifies the classpath entries used to run tests.

      Replaces default classpath. Include the build main and test directories compiled classes are needed.

      Parameters:
      entries - the list of entries
      Returns:
      this operation instance
      Throws:
      NullPointerException - if entries is null or contains null elements
      IllegalArgumentException - if entries is empty or contains blank elements
      See Also:
    • testClasspath

      public Set<String> testClasspath()
      Returns the classpath entries used for running tests.
      Returns:
      the set of test classpath
    • testJar

      public TestNgOperation testJar(String jar)
      Specifies a jar file that contains test classes.

      If a testng.xml file is found at the root of that jar file, it will be used, otherwise, all the test classes found in this jar file will be considered test classes.

      Parameters:
      jar - the jar
      Returns:
      this operation instance
      Throws:
      NullPointerException - if jar is null
      IllegalArgumentException - if jar is blank
    • testName

      public TestNgOperation testName(String name)
      This specifies the default name of test, if not specified in the suite definition file or source code.

      This option is ignored if the suite.xml file or the source code specifies a different test name.

      Parameters:
      name - the name
      Returns:
      this operation instance
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name is blank
    • testNames

      public Set<String> testNames()
      Returns the list of test names to run.
      Returns:
      the set of test names
    • testNames

      public TestNgOperation testNames(String... names)
      Only tests defined in a <test> tag matching one of these names will be run.
      Parameters:
      names - one or more names
      Returns:
      this operation instance
      Throws:
      NullPointerException - if names is null or contains null elements
      IllegalArgumentException - if names is empty or contains blank elements
      See Also:
    • testNames

      public TestNgOperation testNames(Collection<String> names)
      Only tests defined in a <test> tag matching one of these names will be run.
      Parameters:
      names - the list of names
      Returns:
      this operation instance
      Throws:
      NullPointerException - if names is null or contains null elements
      IllegalArgumentException - if names is empty or contains blank elements
      See Also:
    • testRunFactory

      public TestNgOperation testRunFactory(String factory)
      Specifies the factory used to create tests.
      Parameters:
      factory - the factory
      Returns:
      this operation instance
      Throws:
      NullPointerException - if factory is null
      IllegalArgumentException - if factory is blank
    • threadCount

      public TestNgOperation threadCount(int count)
      This sets the default maximum number of threads to use for running tests in parallel.

      It will only take effect if the parallel mode has been selected (for example, with the parallel option).

      This can be overridden in the suite definition.

      Parameters:
      count - the count
      Returns:
      this operation instance
      Throws:
      IllegalArgumentException - if count is negative
    • threadPoolFactoryClass

      public TestNgOperation threadPoolFactoryClass(String factoryClass)
      Specifies the thread pool executor factory implementation that TestNG should use.
      Parameters:
      factoryClass - the factory class
      Returns:
      this operation instance
      Throws:
      NullPointerException - if factoryClass is null
      IllegalArgumentException - if factoryClass is blank
    • useDefaultListeners

      public TestNgOperation useDefaultListeners(boolean isDefaultListener)
      Whether to use the default listeners

      Default is true

      Parameters:
      isDefaultListener - true or false
      Returns:
      this operation instance
    • useGlobalThreadPool

      public TestNgOperation useGlobalThreadPool(boolean useGlobalThreadPool)
      Should TestNG use a global Shared ThreadPool (At suite level) for running regular and data driven tests.
      Parameters:
      useGlobalThreadPool - true or false
      Returns:
      this operation instance
    • verbose

      public TestNgOperation verbose(int level)
      Set the level of verbosity.
      Parameters:
      level - the level
      Returns:
      this operation instance
      Throws:
      IllegalArgumentException - if level is negative
      See Also:
    • xmlPathInJar

      public TestNgOperation xmlPathInJar(String path)
      This attribute should contain the path to a valid XML file inside the test jar (e.g. "resources/testng.xml").

      The default is testng.xml, which means a file called testng.xml at the root of the jar file.

      This option will be ignored unless a test jar is specified.

      Parameters:
      path - the path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if path is null
      IllegalArgumentException - if path is blank
    • xmlPathInJar

      public TestNgOperation xmlPathInJar(File path)
      This attribute should contain the path to a valid XML file inside the test jar (e.g. "resources/testng.xml").

      The default is testng.xml, which means a file called testng.xml at the root of the jar file.

      This option will be ignored unless a test jar is specified.

      Parameters:
      path - the path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if path is null
    • xmlPathInJar

      public TestNgOperation xmlPathInJar(Path path)
      This attribute should contain the path to a valid XML file inside the test jar (e.g. "resources/testng.xml").

      The default is testng.xml, which means a file called testng.xml at the root of the jar file.

      This option will be ignored unless a test jar is specified.

      Parameters:
      path - the path
      Returns:
      this operation instance
      Throws:
      NullPointerException - if path is null