Package 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
timeoutin milliseconds, the default value is 2 minutes - the
useEventLoop configures the event loop usage
truealways runs with an event loopfalsenever runs with an event loopnulluses an event loop if there is one (provided byVertx.currentContext()) otherwise run without- the
reportersis an array of reporter configurations
- Author:
- Julien Viet
- the
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_TIMEOUTThe default time out value in milliseconds: 2 minutes.static BooleanDEFAULT_USE_EVENT_LOOPThe default value for using or not the event loop:null.
-
Constructor Summary
Constructors Constructor 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 Description TestOptionsaddReporter(ReportOptions reportOptions)Add a reporter to the current list.longgetTimeout()BooleanisUseEventLoop()TestOptionssetReporters(List<ReportOptions> reporters)Replace the current list of reporters with a new one.TestOptionssetTimeout(long timeout)Set the test timeout.TestOptionssetUseEventLoop(Boolean useEventLoop)Configure the execution to use an event loop when there is no one existing.JsonObjecttoJson()-
Methods inherited from class io.vertx.ext.unit.report.ReportingOptions
getReporters
-
-
-
-
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:ReportingOptionsAdd a reporter to the current list.- Overrides:
addReporterin classReportingOptions- 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:ReportingOptionsReplace the current list of reporters with a new one.- Overrides:
setReportersin classReportingOptions- Parameters:
reporters- the new reporters- Returns:
- a reference to this, so the API can be used fluently
-
toJson
public JsonObject toJson()
- Overrides:
toJsonin classReportingOptions- Returns:
- the json modelling the current configuration
-
-