// in the test-mods directory (where they actually are) we have to set
// the vertx.mods property and then construct a new cluster instance.
// When the cluster client installs a module to the cluster, it will
// pull the module from the test-mods directory.
System.setProperty("vertx.mods", "src/test/resources/test-mods");
final Cluster cluster = new DefaultCluster("test", vertx, container);
cluster.deployModule("net.kuujo~test-mod-2~1.0", new Handler<AsyncResult<String>>() {
@Override
public void handle(AsyncResult<String> result) {
assertTrue(result.failed());
cluster.installModule("net.kuujo~test-mod-2~1.0", new Handler<AsyncResult<Void>>() {
@Override
public void handle(AsyncResult<Void> result) {
assertTrue(result.succeeded());
cluster.deployModule("net.kuujo~test-mod-2~1.0", new Handler<AsyncResult<String>>() {
@Override
public void handle(AsyncResult<String> result) {
assertTrue(result.succeeded());
assertNotNull(result.result());
vertx.fileSystem().deleteSync("src/test/resources/server-mods", true);