@Override public void start(Future<Void> startFuture) throws Exception { Verticle child = new AbstractVerticle() { @Override public void start(Future<Void> startFuture) throws Exception { startFuture.complete(); // Undeploy it directly vertx.runOnContext(v -> vertx.undeploy(context.deploymentID())); } }; vertx.deployVerticle(child, onSuccess(depID -> { startFuture.complete(); })); }
@Override public void start(Future<Void> startFuture) throws Exception { vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { childDeployed.incrementAndGet(); } @Override public void stop() throws Exception { childUndeployed.incrementAndGet(); } }, onSuccess(child -> { startFuture.fail("Undeployed"); })); } }, onFailure(expected -> {
@Override public void start(Future<Void> startFuture) throws Exception { CountDownLatch latch = new CountDownLatch(1); vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { childDeployed.incrementAndGet(); latch.countDown(); } @Override public void stop() throws Exception { childUndeployed.incrementAndGet(); } }); awaitLatch(latch); throw new RuntimeException(); } }, onFailure(expected -> {
@Override public void start(Future<Void> startFuture) throws Exception { vertx.deployVerticle(new AbstractVerticle() { @Override public void start(Future<Void> fut) throws Exception { vertx.setTimer(100, id -> { fut.complete(); }); } @Override public void stop() throws Exception { waitUntil(() -> parentFailed.get() == 1); testComplete(); } }); parentFailed.incrementAndGet(); throw new RuntimeException(); } });
@Override public void start() throws Exception { vertx.deployVerticle(new AbstractVerticle() { }, id -> vertx.undeploy(id.result())); } };
@Override public void start(Future<Void> startFuture) throws Exception { Verticle child = new AbstractVerticle() { @Override public void start(Future<Void> startFuture) throws Exception { startFuture.complete(); // Undeploy it directly vertx.runOnContext(v -> vertx.undeploy(context.deploymentID())); } }; vertx.deployVerticle(child, onSuccess(depID -> { startFuture.complete(); })); }
@Override public void start(Future<Void> startFuture) throws Exception { vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { childDeployed.incrementAndGet(); } @Override public void stop() throws Exception { childUndeployed.incrementAndGet(); } }, onSuccess(child -> { startFuture.fail("Undeployed"); })); } }, onFailure(expected -> {
@Override public void start(Future<Void> startFuture) throws Exception { CountDownLatch latch = new CountDownLatch(1); vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { childDeployed.incrementAndGet(); latch.countDown(); } @Override public void stop() throws Exception { childUndeployed.incrementAndGet(); } }); awaitLatch(latch); throw new RuntimeException(); } }, onFailure(expected -> {
@Override public void start() throws Exception { vertx.deployVerticle(new AbstractVerticle() { }, id -> vertx.undeploy(id.result())); } };
@Override public void start(Future<Void> startFuture) throws Exception { vertx.deployVerticle(new AbstractVerticle() { @Override public void start(Future<Void> fut) throws Exception { vertx.setTimer(100, id -> { fut.complete(); }); } @Override public void stop() throws Exception { waitUntil(() -> parentFailed.get() == 1); testComplete(); } }); parentFailed.incrementAndGet(); throw new RuntimeException(); } });