def resp_handler(resp): VertxAssert.assertTrue(200 == resp.status_code) # If we get here, the test is complete # You must always call `testComplete()` at the end. Remember that testing is *asynchronous* so # we cannot assume the test is complete by the time the test method has finished executing like # in standard synchronous tests VertxAssert.testComplete()
def listen_handler(err, server): VertxAssert.assertNull(err) # The server is listening so send an HTTP request vertx.create_http_client().set_port(8181).get_now("/", resp_handler)
def handler(timer_id): VertxAssert.assertNotNull(timer_id) VertxAssert.testComplete()
def test_something_else() : VertxAssert.testComplete()
import vertx from org.vertx.testtools import VertxAssert from org.vertx.java.platform.impl import JythonVerticleFactory VertxAssert.initialize(JythonVerticleFactory.vertx) def start_tests(locs) : method_name = vertx.config()['methodName'] locs[method_name]()
def test_fail_direct(): VertxAssert.fail("failed")
def test_assert_failed_direct(): VertxAssert.assertEquals("foo", "bar")
def handler(): VertxAssert.fail("failed")
def handler(): VertxAssert.assertEquals("foo", "bar")
def test_assert_ok(): VertxAssert.assertEquals('foo', 'foo') VertxAssert.testComplete()
def handler(): VertxAssert.assertEquals("foo", "foo") VertxAssert.testComplete()
def test_1() : VertxAssert.testComplete()
from org.vertx.testtools import VertxAssert import vertx_tests from core.event_bus import EventBus import vertx type = vertx.config()['type'] if type == 'fail': VertxAssert.fail('failed') elif type == 'assert_fail': VertxAssert.assertEquals('foo', 'bar') elif type == 'assert_ok': VertxAssert.assertEquals('foo', 'foo') VertxAssert.testComplete()
def handler(msg): VertxAssert.assertEquals('pong!', msg.body) VertxAssert.testComplete()
def test_foo(): VertxAssert.testComplete()
def handler(err, depID): # Deployment is asynchronous and this this handler will be called when it's complete (or failed) VertxAssert.assertNull(err) # If deployed correctly then start the tests! vertx_tests.start_tests(script)
def test_1(): VertxAssert.testComplete()