Package net.kuujo.vertigo.network.impl

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


    assertEquals(2, verticle4.getInstances());
  }

  @Test
  public void testAddFeederModule() {
    NetworkConfig network = new DefaultNetworkConfig("test");
    assertEquals("test", network.getName());
    ModuleConfig module1 = network.addModule("module1", "com.test~test-module~1.0");
    assertEquals("module1", module1.getName());
    assertTrue(module1.getType().equals(ComponentConfig.Type.MODULE));
    assertEquals("com.test~test-module~1.0", module1.getModule());
    assertEquals(new JsonObject(), module1.getConfig());
    assertEquals(1, module1.getInstances());
    ModuleConfig module2 = network.addModule("module2", "com.test~test-module~2.0", new JsonObject().putString("foo", "bar"));
    assertEquals("module2", module2.getName());
    assertTrue(module2.getType().equals(ComponentConfig.Type.MODULE));
    assertEquals("com.test~test-module~2.0", module2.getModule());
    assertEquals("bar", module2.getConfig().getString("foo"));
    assertEquals(1, module2.getInstances());
    ModuleConfig module3 = network.addModule("module3", "com.test~test-module~3.0", 2);
    assertEquals("module3", module3.getName());
    assertTrue(module3.getType().equals(ComponentConfig.Type.MODULE));
    assertEquals("com.test~test-module~3.0", module3.getModule());
    assertEquals(new JsonObject(), module3.getConfig());
    assertEquals(2, module3.getInstances());
    ModuleConfig module4 = network.addModule("module4", "com.test~test-module~4.0", new JsonObject().putString("foo", "bar"), 2);
    assertEquals("module4", module4.getName());
    assertTrue(module4.getType().equals(ComponentConfig.Type.MODULE));
    assertEquals("com.test~test-module~4.0", module4.getModule());
    assertEquals("bar", module4.getConfig().getString("foo"));
    assertEquals(2, module4.getInstances());
View Full Code Here


*/
public class ContextTest {

  @Test
  public void testDefaultNetworkContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    assertEquals(0, context.components().size());
  }
View Full Code Here

    assertEquals(0, context.components().size());
  }

  @Test
  public void testConfiguredNetworkContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    assertEquals(0, context.components().size());
  }
View Full Code Here

    assertEquals(0, context.components().size());
  }

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

    assertNotNull(verticleContext.network());
  }

  @Test
  public void testConfiguredFeederVerticleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    VerticleConfig verticle = network.addVerticle("feeder", "feeder.py");
    verticle.setMain("feeder.py");
    verticle.setConfig(new JsonObject().putString("foo", "bar"));
    verticle.setInstances(2);
    verticle.setGroup("test");
    verticle.setWorker(true);
View Full Code Here

    assertNotNull(verticleContext.network());
  }

  @Test
  public void testDefaultFeederModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addModule("feeder", "com.test~test-module~1.0");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("feeder");
    assertEquals("feeder", moduleContext.name());
    assertEquals("vertigo.test.feeder", moduleContext.address());
View Full Code Here

    assertNotNull(moduleContext.network());
  }

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

    assertNotNull(moduleContext.network());
  }

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

    assertNotNull(verticleContext.network());
  }

  @Test
  public void testConfiguredWorkerVerticleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    VerticleConfig verticle = network.addVerticle("worker", "worker.py");
    verticle.setMain("worker.py");
    verticle.setConfig(new JsonObject().putString("foo", "bar"));
    verticle.setInstances(2);
    verticle.setGroup("test");
    verticle.setWorker(true);
View Full Code Here

    assertNotNull(verticleContext.network());
  }

  @Test
  public void testDefaultWorkerModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addModule("worker", "com.test~test-module~1.0");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("worker");
    assertEquals("worker", moduleContext.name());
    assertEquals("vertigo.test.worker", moduleContext.address());
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.