Package net.kuujo.vertigo.network.impl

Examples of net.kuujo.vertigo.network.impl.DefaultNetworkConfig


    assertNotNull(moduleContext.network());
  }

  @Test
  public void testConfiguredWorkerModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    ModuleConfig module = network.addModule("worker", "com.test~test-module~1.0");
    module.setModule("com.test~test-module~1.0");
    module.setConfig(new JsonObject().putString("foo", "bar"));
    module.setInstances(2);
    module.setGroup("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
View Full Code Here


    assertNotNull(moduleContext.network());
  }

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

    assertNotNull(verticleContext.instances().get(0).component());
  }

  @Test
  public void testUpdateContext() {
    NetworkConfig network = new DefaultNetworkConfig("test");
    network.addVerticle("sender", "sender.py", 2);
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    NetworkConfig network2 = new DefaultNetworkConfig("test");
    network2.addVerticle("receiver", "receiver.py", 2);
    NetworkContext context2 = ContextBuilder.buildContext(network2, "vertigo");
    assertNotNull(context2.component("receiver"));
    context.notify(context2);
    assertNotNull(context.component("receiver"));
  }
View Full Code Here

   *
   * @return A new network instance.
   * @see Vertigo#createNetework(String)
   */
  public NetworkConfig createNetwork() {
    return new DefaultNetworkConfig();
  }
View Full Code Here

   * @param name The network name.
   * @return A new network instance.
   * @see Vertigo#createNetwork()
   */
  public NetworkConfig createNetwork(String name) {
    return new DefaultNetworkConfig(name);
  }
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.network.impl.DefaultNetworkConfig

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.