final Vertigo vertigo = new Vertigo(this);
vertigo.deployCluster(new Handler<AsyncResult<Cluster>>() {
@Override
public void handle(AsyncResult<Cluster> result) {
assertTrue(result.succeeded());
NetworkConfig network = vertigo.createNetwork("test-get-network-1");
network.addVerticle("feeder", TestFeeder.class.getName());
network.addVerticle("worker", TestWorker.class.getName(), 2);
network.createConnection("feeder", "stream", "worker", "stream");
final Cluster cluster = result.result();
cluster.deployNetwork(network, new Handler<AsyncResult<ActiveNetwork>>() {
@Override
public void handle(AsyncResult<ActiveNetwork> result) {
assertTrue(result.succeeded());
NetworkConfig network = vertigo.createNetwork("test-get-network-2");
network.addVerticle("feeder", TestFeeder.class.getName());
network.addVerticle("worker", TestWorker.class.getName(), 2);
network.createConnection("feeder", "stream", "worker", "stream");
cluster.deployNetwork(network, new Handler<AsyncResult<ActiveNetwork>>() {
@Override
public void handle(AsyncResult<ActiveNetwork> result) {
assertTrue(result.succeeded());
cluster.getNetwork("test-get-network-1", new Handler<AsyncResult<ActiveNetwork>>() {