org.codehaus.groovy.testng

## Class TestNgRunner

- java.lang.Object
- - org.codehaus.groovy.testng.TestNgRunner

- All Implemented Interfaces:
    GroovyRunner

      public class TestNgRunner
      extends Object
      implements GroovyRunner

  Integration code for running TestNG tests in Groovy.
  Author:
    Paul King

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestNgRunner()`

  - ### Method Summary

    Methods
    Modifier and Type | Method 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.&nsbp;checks whether it appears to be using the relevant TestNG annotations.
    `Object` | `run(Class scriptClass, GroovyClassLoader loader)` Utility method to run a TestNG test.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TestNgRunner

          public TestNgRunner()

  - ### Method Detail

    - #### canRun

          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.&nsbp;checks whether it appears to be using the relevant TestNG annotations.
      Specified by:
        `canRun` in interface `GroovyRunner`
      Parameters:
        `scriptClass` - the class we want to check
        `loader` - the GroovyClassLoader to use to find classes
      Returns:
        true if the class appears to be a test

    - #### run

          public Object run(Class scriptClass,
                   GroovyClassLoader loader)

      Utility method to run a TestNG test.
      Specified by:
        `run` in interface `GroovyRunner`
      Parameters:
        `scriptClass` - the class we want to run as a test
        `loader` - the class loader to use
      Returns:
        the result of running the test