/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID * @return * @deprecated use {@link #rxUndeploy} instead */ @Deprecated() public Observable<Void> undeployObservable(String deploymentID) { io.vertx.rx.java.ObservableFuture<Void> completionHandler = io.vertx.rx.java.RxHelper.observableFuture(); undeploy(deploymentID, completionHandler.toHandler()); return completionHandler; }
/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID * @return */ public Single<Void> rxUndeploy(String deploymentID) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { undeploy(deploymentID, fut); })); }
/** * Like {@link io.vertx.rxjava.core.Vertx #undeploy(String)} but the completionHandler will be notified when the undeployment is complete. * @param deploymentID the deployment ID * @return */ public Single<Void> rxUndeploy(String deploymentID) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { undeploy(deploymentID, fut); })); }
@Test public void testStop() { vertx.deployVerticle(StopVerticle.class.getName(), onSuccess(id -> { vertx.undeploy(id, onSuccess(v -> testComplete())); })); await(); }
@Test public void testStopWithError() { vertx.deployVerticle(StopVerticleWithError.class.getName(), onSuccess(id -> { vertx.undeploy(id, onFailure(t -> { assertEquals(t, err); testComplete(); })); })); await(); }
@Test public void testStopWithFailure() { vertx.deployVerticle(StopVerticleWithFailure.class.getName(), onSuccess(id -> { vertx.undeploy(id, onFailure(t -> { assertEquals(t, err); testComplete(); })); })); await(); }
@Test public void testStopSynchronously() { vertx.deployVerticle(StopVerticleSynchronously.class.getName(), onSuccess(id -> { vertx.undeploy(id, onSuccess(v -> { assertEquals(1, stoppedCount); testComplete(); })); })); await(); } }