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.| Type | Name and description |
|---|---|
TestSuite |
after(Handler<TestContext> callback)Set a callback executed after the tests. |
TestSuite |
afterEach(Handler<TestContext> callback)Set a callback executed after each test and before the suite after callback. |
TestSuite |
before(Handler<TestContext> callback)Set a callback executed before the tests. |
TestSuite |
beforeEach(Handler<TestContext> callback)Set a callback executed before each test and after the suite before callback. |
static TestSuite |
create(String name)Create and return a new test suite. |
Object |
getDelegate() |
TestCompletion |
run()Run the testsuite with the default options. |
TestCompletion |
run(Map<String, 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, Map<String, Object> options)Run the testsuite with the specified options and the specified vertx instance. |
TestSuite |
test(String name, Handler<TestContext> testCase)Add a new test case to the suite. |
Set a callback executed after the tests.
callback - the callback Set a callback executed after each test and before the suite after callback.
callback - the callbackSet a callback executed before the tests.
callback - the callback Set a callback executed before each test and after the suite before callback.
callback - the callbackCreate and return a new test suite.
name - the test suite nameRun 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. Run the testsuite with the specified options.
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.
options - the test options (see TestOptions) Run the testsuite with the default options and the specified vertx instance.
vertx argument. The returned
Completion object can be used to get a completion callback.
vertx - the vertx instance Run the testsuite with the specified options and the specified vertx instance.
vertx argument when
TestOptions is not set to false. The returned
Completion object can be used to get a completion callback.
vertx - the vertx instanceoptions - the test options (see TestOptions)Add a new test case to the suite.
name - the test case nametestCase - the test caseio.vertx:vertx-unit:3.1.0