io.vertx.ext.unit

## Class TestOptions

- java.lang.Object
- - io.vertx.ext.unit.report.ReportingOptions
  - - io.vertx.ext.unit.TestOptions

-     public class TestOptions
      extends ReportingOptions

  Test execution options:
  - the `timeout` in milliseconds, the default value is 2 minutes
  - the `useEventLoop`
  configures the event loop usage
  - `true` always runs with an event loop
  - `false` never runs with an event loop
  - `null` uses an event loop if there is one (provided by `Vertx.currentContext()`) otherwise run without
- the `reporters` is an array of reporter configurations

Author:
  Julien Viet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `DEFAULT_TIMEOUT` The default time out value in milliseconds: 2 minutes.
    `static Boolean` | `DEFAULT_USE_EVENT_LOOP` The default value for using or not the event loop: `null`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestOptions()` Create a new empty options, with the default time out and no reporters.
    `TestOptions(JsonObject json)` Create a new options from the specified json.
    `TestOptions(TestOptions other)` Copy constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TestOptions` | `addReporter(ReportOptions reportOptions)` Add a reporter to the current list.
    `long` | `getTimeout()`
    `Boolean` | `isUseEventLoop()`
    `TestOptions` | `setReporters(List<ReportOptions> reporters)` Replace the current list of reporters with a new one.
    `TestOptions` | `setTimeout(long timeout)` Set the test timeout.
    `TestOptions` | `setUseEventLoop(Boolean useEventLoop)` Configure the execution to use an event loop when there is no one existing.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class io.vertx.ext.unit.report.ReportingOptions

      `getReporters`

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

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

- - ### Field Detail

    - #### DEFAULT_TIMEOUT

          public static final long DEFAULT_TIMEOUT

      The default time out value in milliseconds: 2 minutes.
      See Also:
        Constant Field Values

    - #### DEFAULT_USE_EVENT_LOOP

          public static final Boolean DEFAULT_USE_EVENT_LOOP

      The default value for using or not the event loop: `null`.

  - ### Constructor Detail

    - #### TestOptions

          public TestOptions()

      Create a new empty options, with the default time out and no reporters.

    - #### TestOptions

          public TestOptions(TestOptions other)

      Copy constructor.
      Parameters:
        `other` - the options to copy

    - #### TestOptions

          public TestOptions(JsonObject json)

      Create a new options from the specified json.
      Parameters:
        `json` - the json to create from

  - ### Method Detail

    - #### getTimeout

          public long getTimeout()

      Returns:
        the current timeout in milliseconds.

    - #### setTimeout

          public TestOptions setTimeout(long timeout)

      Set the test timeout.
      Parameters:
        `timeout` - the timeout value in milliseconds.
      Returns:
        a reference to this, so the API can be used fluently

    - #### isUseEventLoop

          public Boolean isUseEventLoop()

      Returns:
        true if the execution should use an event loop when there is no one existing

    - #### setUseEventLoop

          public TestOptions setUseEventLoop(Boolean useEventLoop)

      Configure the execution to use an event loop when there is no one existing.
      Parameters:
        `useEventLoop` - the even loop usage
      Returns:
        a reference to this, so the API can be used fluently

    - #### addReporter

          public TestOptions addReporter(ReportOptions reportOptions)

      Description copied from class: `ReportingOptions`
      Add a reporter to the current list.
      Overrides:
        `addReporter` in class `ReportingOptions`
      Parameters:
        `reportOptions` - the options of the reporter to use
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReporters

          public TestOptions setReporters(List<ReportOptions> reporters)

      Description copied from class: `ReportingOptions`
      Replace the current list of reporters with a new one.
      Overrides:
        `setReporters` in class `ReportingOptions`
      Parameters:
        `reporters` - the new reporters
      Returns:
        a reference to this, so the API can be used fluently

    - #### toJson

          public JsonObject toJson()

      Overrides:
        `toJson` in class `ReportingOptions`
      Returns:
        the json modelling the current configuration

Copyright © 2017. All rights reserved.