Package net.kuujo.vertigo.component

Examples of net.kuujo.vertigo.component.VerticleContext


  public void testDefaultFeederVerticleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addVerticle("feeder", "feeder.py");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    VerticleContext verticleContext = context.component("feeder");
    assertEquals("feeder", verticleContext.name());
    assertEquals("vertigo.test.feeder", verticleContext.address());
    assertEquals("feeder.py", verticleContext.main());
    assertTrue(verticleContext.isVerticle());
    assertFalse(verticleContext.isModule());
    assertEquals(new JsonObject(), verticleContext.config());
    assertEquals(1, verticleContext.numInstances());
    assertFalse(verticleContext.isWorker());
    assertFalse(verticleContext.isMultiThreaded());
    assertNotNull(verticleContext.network());
  }
View Full Code Here


    verticle.setGroup("test");
    verticle.setWorker(true);
    verticle.setMultiThreaded(true);
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    VerticleContext verticleContext = context.component("feeder");
    assertEquals("feeder", verticleContext.name());
    assertEquals("vertigo.test.feeder", verticleContext.address());
    assertEquals("feeder.py", verticleContext.main());
    assertTrue(verticleContext.isVerticle());
    assertFalse(verticleContext.isModule());
    assertEquals("bar", verticleContext.config().getString("foo"));
    assertEquals(2, verticleContext.numInstances());
    assertEquals(2, verticleContext.instances().size());
    assertTrue(verticleContext.isWorker());
    assertTrue(verticleContext.isMultiThreaded());
    assertEquals("test", verticleContext.group());
    assertNotNull(verticleContext.network());
  }
View Full Code Here

  public void testDefaultWorkerVerticleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addVerticle("worker", "worker.py");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    VerticleContext verticleContext = context.component("worker");
    assertEquals("worker", verticleContext.name());
    assertEquals("vertigo.test.worker", verticleContext.address());
    assertEquals("worker.py", verticleContext.main());
    assertTrue(verticleContext.isVerticle());
    assertFalse(verticleContext.isModule());
    assertEquals(new JsonObject(), verticleContext.config());
    assertEquals(1, verticleContext.numInstances());
    assertFalse(verticleContext.isWorker());
    assertFalse(verticleContext.isMultiThreaded());
    assertNotNull(verticleContext.network());
  }
View Full Code Here

    verticle.setGroup("test");
    verticle.setWorker(true);
    verticle.setMultiThreaded(true);
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    VerticleContext verticleContext = context.component("worker");
    assertEquals("worker", verticleContext.name());
    assertEquals("vertigo.test.worker", verticleContext.address());
    assertEquals("worker.py", verticleContext.main());
    assertTrue(verticleContext.isVerticle());
    assertFalse(verticleContext.isModule());
    assertEquals("bar", verticleContext.config().getString("foo"));
    assertEquals(2, verticleContext.numInstances());
    assertEquals(2, verticleContext.instances().size());
    assertTrue(verticleContext.isWorker());
    assertTrue(verticleContext.isMultiThreaded());
    assertEquals("test", verticleContext.group());
    assertNotNull(verticleContext.network());
  }
View Full Code Here

    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    VerticleConfig verticle = network.addVerticle("feeder", "feeder.py");
    verticle.setInstances(2);
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    VerticleContext verticleContext = context.component("feeder");
    assertEquals("feeder", verticleContext.name());
    assertEquals("vertigo.test.feeder", verticleContext.address());
    assertEquals(2, verticleContext.instances().size());
    assertEquals("vertigo.test.feeder-1", verticleContext.instances().get(0).address());
    assertEquals("vertigo.test.feeder-2", verticleContext.instances().get(1).address());
    assertNotNull(verticleContext.instances().get(0).component());
  }
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.component.VerticleContext

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.