Package io.vertx.reactivex.ext.unit
Class TestSuite
- java.lang.Object
-
- io.vertx.reactivex.ext.unit.TestSuite
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class TestSuite extends Object implements io.vertx.lang.rx.RxDelegate
A named suite of test cases that are executed altogether. The suite suite is created with thecreate(java.lang.String)and the returned suite contains initially no tests. The suite can declare a callback before the suite withbefore(io.vertx.core.Handler<io.vertx.reactivex.ext.unit.TestContext>)or after the suite withafter(io.vertx.core.Handler<io.vertx.reactivex.ext.unit.TestContext>). The suite can declare a callback before each test withbeforeEach(io.vertx.core.Handler<io.vertx.reactivex.ext.unit.TestContext>)or after each test withafterEach(io.vertx.core.Handler<io.vertx.reactivex.ext.unit.TestContext>). Each test case of the suite is declared by calling thetest(java.lang.String, io.vertx.core.Handler<io.vertx.reactivex.ext.unit.TestContext>)method.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<TestSuite>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TestSuiteafter(Handler<TestContext> callback)Set a callback executed after the tests.TestSuiteafterEach(Handler<TestContext> callback)Set a callback executed after each test and before the suiteaftercallback.TestSuitebefore(Handler<TestContext> callback)Set a callback executed before the tests.TestSuitebeforeEach(Handler<TestContext> callback)Set a callback executed before each test and after the suitebeforecallback.static TestSuitecreate(String name)Create and return a new test suite.booleanequals(Object o)TestSuitegetDelegate()inthashCode()static TestSuitenewInstance(TestSuite arg)TestCompletionrun()Run the testsuite with the default options.TestCompletionrun(TestOptions options)Run the testsuite with the specifiedoptions.TestCompletionrun(Vertx vertx)Run the testsuite with the default options and the specifiedvertxinstance.TestCompletionrun(Vertx vertx, TestOptions options)Run the testsuite with the specifiedoptionsand the specifiedvertxinstance.TestSuitetest(String name, int repeat, Handler<TestContext> testCase)Add a new test case to the suite.TestSuitetest(String name, Handler<TestContext> testCase)Add a new test case to the suite.StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<TestSuite> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public TestSuite getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
create
public static TestSuite create(String name)
Create and return a new test suite.- Parameters:
name- the test suite name- Returns:
- the created test suite
-
before
public TestSuite before(Handler<TestContext> callback)
Set a callback executed before the tests.- Parameters:
callback- the callback- Returns:
- a reference to this, so the API can be used fluently
-
beforeEach
public TestSuite beforeEach(Handler<TestContext> callback)
Set a callback executed before each test and after the suitebeforecallback.- Parameters:
callback- the callback- Returns:
- a reference to this, so the API can be used fluently
-
after
public TestSuite after(Handler<TestContext> callback)
Set a callback executed after the tests.- Parameters:
callback- the callback- Returns:
- a reference to this, so the API can be used fluently
-
afterEach
public TestSuite afterEach(Handler<TestContext> callback)
Set a callback executed after each test and before the suiteaftercallback.- Parameters:
callback- the callback- Returns:
- a reference to this, so the API can be used fluently
-
test
public TestSuite test(String name, Handler<TestContext> testCase)
Add a new test case to the suite.- Parameters:
name- the test case nametestCase- the test case- Returns:
- a reference to this, so the API can be used fluently
-
test
public TestSuite test(String name, int repeat, Handler<TestContext> testCase)
Add a new test case to the suite.- Parameters:
name- the test case namerepeat- the number of times the test should be repeatedtestCase- the test case- Returns:
- a reference to this, so the API can be used fluently
-
run
public 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 returnedCompletionobject can be used to get a completion callback.- Returns:
- the related test completion
-
run
public TestCompletion run(TestOptions options)
Run the testsuite with the specifiedoptions. 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 theTestOptionsis set tofalse. In this case it is executed by the current thread. Otherwise, the test suite will be executed in the current thread whenTestOptionsis set tofalseornull. If the value istrue, this methods throws anIllegalStateException. The returnedCompletionobject can be used to get a completion callback.- Parameters:
options- the test options- Returns:
- the related test completion
-
run
public TestCompletion run(Vertx vertx)
Run the testsuite with the default options and the specifiedvertxinstance. The test suite will be executed on the event loop provided by thevertxargument. The returnedCompletionobject can be used to get a completion callback.- Parameters:
vertx- the vertx instance- Returns:
- the related test completion
-
run
public TestCompletion run(Vertx vertx, TestOptions options)
Run the testsuite with the specifiedoptionsand the specifiedvertxinstance. The test suite will be executed on the event loop provided by thevertxargument whenTestOptionsis not set tofalse. The returnedCompletionobject can be used to get a completion callback.- Parameters:
vertx- the vertx instanceoptions- the test options- Returns:
- the related test completion
-
-