Package: io.vertx.groovy.ext.unit

## [Groovy] Class TestSuite

- io.vertx.groovy.ext.unit.TestSuite

- A named suite of test cases that are executed altogether. The suite suite is created with the TestSuite.create and the returned suite contains initially no tests.

  The suite can declare a callback before the suite with TestSuite.before or after the suite with TestSuite.after.

  The suite can declare a callback before each test with TestSuite.beforeEach or after each test with TestSuite.afterEach.

  Each test case of the suite is declared by calling the TestSuite.test method.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `TestSuite (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `TestSuite` | `after(io.vertx.core.Handler<TestContext> callback)` Set a callback executed after the tests.
    `TestSuite` | `afterEach(io.vertx.core.Handler<TestContext> callback)` Set a callback executed after each test and before the suite `after` callback.
    `TestSuite` | `before(io.vertx.core.Handler<TestContext> callback)` Set a callback executed before the tests.
    `TestSuite` | `beforeEach(io.vertx.core.Handler<TestContext> callback)` Set a callback executed before each test and after the suite `before` callback.
    `static TestSuite` | `create(java.lang.String name)` Create and return a new test suite.
    `java.lang.Object` | `getDelegate()`
    `TestCompletion` | `run()` Run the testsuite with the default options.
    `TestCompletion` | `run(java.util.Map<java.lang.String, java.lang.Object> options)` Run the testsuite with the specified `options`.
    `TestCompletion` | `run(Vertx vertx)` Run the testsuite with the default options and the specified `vertx` instance.
    `TestCompletion` | `run(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options)` Run the testsuite with the specified `options` and the specified `vertx` instance.
    `TestSuite` | `test(java.lang.String name, io.vertx.core.Handler<TestContext> testCase)` Add a new test case to the suite.
    `TestSuite` | `test(java.lang.String name, int repeat, io.vertx.core.Handler<TestContext> testCase)` Add a new test case to the suite.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### TestSuite(java.lang.Object delegate)

  - ### Method Detail

    - #### TestSuite after(io.vertx.core.Handler<TestContext> callback)

      Set a callback executed after the tests.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `callback` - the callback

    - #### TestSuite afterEach(io.vertx.core.Handler<TestContext> callback)

      Set a callback executed after each test and before the suite `after` callback.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `callback` - the callback

    - #### TestSuite before(io.vertx.core.Handler<TestContext> callback)

      Set a callback executed before the tests.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `callback` - the callback

    - #### TestSuite beforeEach(io.vertx.core.Handler<TestContext> callback)

      Set a callback executed before each test and after the suite `before` callback.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `callback` - the callback

    - #### static TestSuite create(java.lang.String name)

      Create and return a new test suite.

      Returns:
        the created test suite
      Parameters:
        `name` - the test suite name

    - #### java.lang.Object getDelegate()

    - #### TestCompletion run()

      Run the testsuite with the default options.

      When the test suite is executed in a Vertx context (i.e `Vertx.currentContext()` returns a context) this context's event loop is used for running the test suite. Otherwise it is executed in the current thread.

      The returned Completion object can be used to get a completion callback.
      Returns:
        the related test completion

    - #### TestCompletion run(java.util.Map<java.lang.String, java.lang.Object> options)

      Run the testsuite with the specified `options`.

      When the test suite is executed in a Vertx context (i.e `Vertx.currentContext()` returns a context) this context's event loop is used for running the test suite unless the TestOptions is set to `false`. In this case it is executed by the current thread.

      Otherwise, the test suite will be executed in the current thread when TestOptions is set to `false` or `null`. If the value is `true`, this methods throws an `IllegalStateException`.

      The returned Completion object can be used to get a completion callback.
      Returns:
        the related test completion
      Parameters:
        `options` - the test options (see TestOptions)

    - #### TestCompletion run(Vertx vertx)

      Run the testsuite with the default options and the specified `vertx` instance.

      The test suite will be executed on the event loop provided by the `vertx` argument. The returned Completion object can be used to get a completion callback.

      Returns:
        the related test completion
      Parameters:
        `vertx` - the vertx instance

    - #### TestCompletion run(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options)

      Run the testsuite with the specified `options` and the specified `vertx` instance.

      The test suite will be executed on the event loop provided by the `vertx` argument when TestOptions is not set to `false`. The returned Completion object can be used to get a completion callback.
      Returns:
        the related test completion
      Parameters:
        `vertx` - the vertx instance
        `options` - the test options (see TestOptions)

    - #### TestSuite test(java.lang.String name, io.vertx.core.Handler<TestContext> testCase)

      Add a new test case to the suite.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the test case name
        `testCase` - the test case

    - #### TestSuite test(java.lang.String name, int repeat, io.vertx.core.Handler<TestContext> testCase)

      Add a new test case to the suite.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the test case name
        `repeat` - the number of times the test should be repeated
        `testCase` - the test case