Skip to content

Instantly share code, notes, and snippets.

@purplefox
Created October 6, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purplefox/4b72f8b891d846ce68a6 to your computer and use it in GitHub Desktop.
Save purplefox/4b72f8b891d846ce68a6 to your computer and use it in GitHub Desktop.
@Test
public void testCloseRegistryOnVertxClose(TestContext context) throws Exception {
Vertx vertx = Vertx.vertx();
CommandRegistryImpl registry = (CommandRegistryImpl) CommandRegistry.get(vertx);
context.assertFalse(registry.isClosed());
CountDownLatch latch = new CountDownLatch(1);
vertx.close(context.asyncAssertSuccess(v -> {
context.assertTrue(registry.isClosed());
latch.countDown();
}));
latch.await(10, TimeUnit.SECONDS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment