TestNgRunner (groovy 2.4.9 API)
Date: 2017-02-24

Package: org.codehaus.groovy.testng

## [Java] Class TestNgRunner

- org.codehaus.groovy.testng.TestNgRunner

- All Implemented Interfaces and Traits:
    GroovyRunner

      public class TestNgRunner

  Integration code for running TestNG tests in Groovy.

  Authors:
    Paul King

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `canRun(Class scriptClass, GroovyClassLoader loader)` Utility method to check via reflection if the parsed class appears to be a TestNG test, i.e. checks whether it appears to be using the relevant TestNG annotations.
    `` | `Object` | `run(Class scriptClass, GroovyClassLoader loader)` Utility method to run a TestNG test.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Method Detail

    - #### @SuppressWarnings("unchecked") public boolean canRun(Class scriptClass, GroovyClassLoader loader)

      Utility method to check via reflection if the parsed class appears to be a TestNG test, i.e. checks whether it appears to be using the relevant TestNG annotations.

      Returns:
        true if the class appears to be a test
      Parameters:
        `scriptClass` - the class we want to check
        `loader` - the GroovyClassLoader to use to find classes

    - #### public Object run(Class scriptClass, GroovyClassLoader loader)

      Utility method to run a TestNG test.

      Returns:
        the result of running the test
      Parameters:
        `scriptClass` - the class we want to run as a test
        `loader` - the class loader to use