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>>() {
@Override
public void handle(AsyncResult<ActiveNetwork> result) {
assertTrue(result.succeeded());
assertEquals("test-get-network-1", result.result().getConfig().getName());
testComplete();