Package net.kuujo.vertigo

Examples of net.kuujo.vertigo.Vertigo


    });
  }

  @Test
  public void testUndeployByConfig() {
    final Vertigo vertigo = new Vertigo(this);
    vertigo.deployCluster(new Handler<AsyncResult<Cluster>>() {
      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final NetworkConfig network = vertigo.createNetwork("test-undeploy-by-config");
        network.addVerticle("feeder", TestFeeder.class.getName());
        network.addVerticle("worker1", TestWorker.class.getName(), 2);
        network.createConnection("feeder", "stream1", "worker", "stream1");
        network.addVerticle("worker2", TestWorker.class.getName(), 2);
        network.createConnection("feeder", "stream2", "worker", "stream2");
View Full Code Here


    });
  }

  @Test
  public void testGetNetwork() {
    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
View Full Code Here

    });
  }

  @Test
  public void testGetNetworks() {
    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-networks-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-networks-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
View Full Code Here

    });
  }

  @Test
  public void testDeployWithCircularConnections() {
    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-circular-deploy");
        network.addVerticle("feeder", TestFeeder.class.getName());
        network.addVerticle("worker", TestWorker.class.getName());
        network.createConnection("feeder", "out", "worker", "in");
        network.createConnection("worker", "out", "feeder", "in");
View Full Code Here

    });
  }

  @Test
  public void testDeployWithBrokenConnection() {
    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-broken-deploy");
        network.addVerticle("feeder", TestFeeder.class.getName());
        network.addVerticle("worker", TestWorker.class.getName(), 2);
        network.createConnection("feeder", "stream", "worker", "stream");
        network.createConnection("worker", "out", "nowhere", "in");
View Full Code Here

  public static class TestWorker extends ComponentVerticle {
  }

  @Test
  public void testDeployMerge() {
    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-deploy-merge");
        network.addVerticle("feeder", TestFeeder.class.getName());
        network.addVerticle("worker", TestWorker.class.getName());
        network.createConnection("feeder", "out", "worker", "in");

        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-deploy-merge");
            network.addVerticle("feeder2", TestFeeder.class.getName());
            network.addVerticle("worker2", TestWorker.class.getName());
            network.createConnection("feeder2", "out", "worker2", "in");

            cluster.deployNetwork(network, new Handler<AsyncResult<ActiveNetwork>>() {
View Full Code Here

*/
public class AsyncSetTest extends TestVerticle {

  @Test
  public void testSetAdd() {
    Vertigo vertigo = new Vertigo(this);
    vertigo.deployCluster("test", new Handler<AsyncResult<Cluster>>() {
      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final Cluster cluster = new DefaultCluster("test", vertx, container);
        final AsyncSet<String> data = cluster.getSet("test-set-add");
View Full Code Here

    });
  }

  @Test
  public void testSetContains() {
    Vertigo vertigo = new Vertigo(this);
    vertigo.deployCluster("test", new Handler<AsyncResult<Cluster>>() {
      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final Cluster cluster = new DefaultCluster("test", vertx, container);
        final AsyncSet<String> data = cluster.getSet("test-set-contains");
View Full Code Here

    });
  }

  @Test
  public void testSetRemove() {
    Vertigo vertigo = new Vertigo(this);
    vertigo.deployCluster("test", new Handler<AsyncResult<Cluster>>() {
      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final Cluster cluster = new DefaultCluster("test", vertx, container);
        final AsyncSet<String> data = cluster.getSet("test-set-remove");
View Full Code Here

    });
  }

  @Test
  public void testSetSize() {
    Vertigo vertigo = new Vertigo(this);
    vertigo.deployCluster("test", new Handler<AsyncResult<Cluster>>() {
      @Override
      public void handle(AsyncResult<Cluster> result) {
        assertTrue(result.succeeded());
        final Cluster cluster = new DefaultCluster("test", vertx, container);
        final AsyncSet<String> data = cluster.getSet("test-set-size");
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.Vertigo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.