Vert.x - Test

Java Conceptuel Diagram

Example

Snippet 1

@Test /*(timeout=5000)*/  
public void async_behavior(TestContext context) { 
	Vertx vertx = Vertx.vertx(); 
	context.assertEquals("foo", "foo");  
	Async a1 = context.async();  
	Async a2 = context.async(3);  
	vertx.setTimer(100, n -> a1.complete());  
	vertx.setPeriodic(100, n -> a2.countDown());  
}

with Vert.x - Timer/Periodic

Run a verticle

Vert.x - Verticle

@Test
public void runVerticle() {
      io.vertx.core.Launcher.executeCommand("run", VerticleHttpServer.class.getName());
}

Documentation







Share this page:
Follow us:
Task Runner