public class TestContext extends Object
original
non RX-ified interface using Vert.x codegen.Constructor and Description |
---|
TestContext(TestContext delegate) |
Modifier and Type | Method and Description |
---|---|
TestContext |
assertEquals(Object expected,
Object actual)
Assert the
expected argument is equals to the actual argument. |
TestContext |
assertEquals(Object expected,
Object actual,
String message)
Assert the
expected argument is equals to the actual argument. |
TestContext |
assertFalse(boolean condition)
Assert the specified
condition is false . |
TestContext |
assertFalse(boolean condition,
String message)
Assert the specified
condition is false . |
TestContext |
assertInRange(double expected,
double actual,
double delta)
Asserts that the
expected double argument is equals to the actual double argument
within a positive delta. |
TestContext |
assertInRange(double expected,
double actual,
double delta,
String message)
Asserts that the
expected double argument is equals to the actual double argument
within a positive delta. |
TestContext |
assertNotEquals(Object first,
Object second)
Assert the
first argument is not equals to the second argument. |
TestContext |
assertNotEquals(Object first,
Object second,
String message)
Assert the
first argument is not equals to the second argument. |
TestContext |
assertNotNull(Object expected)
Assert the
expected argument is not null . |
TestContext |
assertNotNull(Object expected,
String message)
Assert the
expected argument is not null . |
TestContext |
assertNull(Object expected)
Assert the
expected argument is null . |
TestContext |
assertNull(Object expected,
String message)
Assert the
expected argument is null . |
TestContext |
assertTrue(boolean condition)
Assert the specified
condition is true . |
TestContext |
assertTrue(boolean condition,
String message)
Assert the specified
condition is true . |
Async |
async()
Create and returns a new async object, the returned async controls the completion of the test.
|
Async |
async(int count)
Create and returns a new async object, the returned async controls the completion of the test.
|
void |
fail()
Throw a failure.
|
void |
fail(String message)
Throw a failure with the specified failure
message . |
void |
fail(Throwable cause)
Throw a failure with the specified failure
cause . |
<T> T |
get(String key)
Get some data from the context.
|
Object |
getDelegate() |
static TestContext |
newInstance(TestContext arg) |
<T> T |
put(String key,
Object value)
Put some data in the context.
|
<T> T |
remove(String key)
Remove some data from the context.
|
public TestContext(TestContext delegate)
public Object getDelegate()
public <T> T get(String key)
key
- the key of the datapublic <T> T put(String key, Object value)
This can be used to share data between different tests and before/after phases.
key
- the key of the datavalue
- the datapublic <T> T remove(String key)
key
- the key to removepublic TestContext assertNull(Object expected)
expected
argument is null
. If the argument is not, an assertion error is thrown
otherwise the execution continue.expected
- the argument being asserted to be nullpublic TestContext assertNull(Object expected, String message)
expected
argument is null
. If the argument is not, an assertion error is thrown
otherwise the execution continue.expected
- the argument being asserted to be nullmessage
- the failure messagepublic TestContext assertNotNull(Object expected)
expected
argument is not null
. If the argument is null
, an assertion error is thrown
otherwise the execution continue.expected
- the argument being asserted to be not nullpublic TestContext assertNotNull(Object expected, String message)
expected
argument is not null
. If the argument is null
, an assertion error is thrown
otherwise the execution continue.expected
- the argument being asserted to be not nullmessage
- the failure messagepublic TestContext assertTrue(boolean condition)
condition
is true
. If the condition is false
, an assertion error is thrown
otherwise the execution continue.condition
- the condition to assertpublic TestContext assertTrue(boolean condition, String message)
condition
is true
. If the condition is false
, an assertion error is thrown
otherwise the execution continue.condition
- the condition to assertmessage
- the failure messagepublic TestContext assertFalse(boolean condition)
condition
is false
. If the condition is true
, an assertion error is thrown
otherwise the execution continue.condition
- the condition to assertpublic TestContext assertFalse(boolean condition, String message)
condition
is false
. If the condition is true
, an assertion error is thrown
otherwise the execution continue.condition
- the condition to assertmessage
- the failure messagepublic TestContext assertEquals(Object expected, Object actual)
expected
argument is equals to the actual
argument. If the arguments are not equals
an assertion error is thrown otherwise the execution continue.expected
- the object the actual object is supposedly equals toactual
- the actual object to testpublic TestContext assertEquals(Object expected, Object actual, String message)
expected
argument is equals to the actual
argument. If the arguments are not equals
an assertion error is thrown otherwise the execution continue.expected
- the object the actual object is supposedly equals toactual
- the actual object to testmessage
- the failure messagepublic TestContext assertInRange(double expected, double actual, double delta)
expected
double argument is equals to the actual
double argument
within a positive delta. If the arguments do not satisfy this, an assertion error is thrown otherwise
the execution continue.expected
- the object the actual object is supposedly equals toactual
- the actual object to testdelta
- the maximum deltapublic TestContext assertInRange(double expected, double actual, double delta, String message)
expected
double argument is equals to the actual
double argument
within a positive delta. If the arguments do not satisfy this, an assertion error is thrown otherwise
the execution continue.expected
- the object the actual object is supposedly equals toactual
- the actual object to testdelta
- the maximum deltamessage
- the failure messagepublic TestContext assertNotEquals(Object first, Object second)
first
argument is not equals to the second
argument. If the arguments are equals
an assertion error is thrown otherwise the execution continue.first
- the first object to testsecond
- the second object to testpublic TestContext assertNotEquals(Object first, Object second, String message)
first
argument is not equals to the second
argument. If the arguments are equals
an assertion error is thrown otherwise the execution continue.first
- the first object to testsecond
- the second object to testmessage
- the failure messagepublic void fail()
public void fail(String message)
message
.message
- the failure messagepublic void fail(Throwable cause)
cause
.cause
- the failure causepublic Async async()
Async
completes the async operation.
The test case will complete when all the async objects have their Async
method called at least once.
This method shall be used for creating asynchronous exit points for the executed test.public Async async(int count)
Async.complete()
is called count
times.
The test case will complete when all the async objects have their Async.complete()
method called at least once.
This method shall be used for creating asynchronous exit points for the executed test.count
- public static TestContext newInstance(TestContext arg)
Copyright © 2015. All rights reserved.