use of io.vertx.core.spi.VerticleFactory in project vert.x by eclipse.
the class VerticleFactoryTest method testRegisterUnregisterTwo.
@Test
public void testRegisterUnregisterTwo() {
VerticleFactory fact1 = new TestVerticleFactory("foo");
VerticleFactory fact2 = new TestVerticleFactory("bar");
vertx.registerVerticleFactory(fact1);
assertEquals(1, vertx.verticleFactories().size());
vertx.registerVerticleFactory(fact2);
assertEquals(2, vertx.verticleFactories().size());
assertTrue(vertx.verticleFactories().contains(fact1));
assertTrue(vertx.verticleFactories().contains(fact2));
vertx.unregisterVerticleFactory(fact1);
assertFalse(vertx.verticleFactories().contains(fact1));
assertEquals(1, vertx.verticleFactories().size());
assertTrue(vertx.verticleFactories().contains(fact2));
vertx.unregisterVerticleFactory(fact2);
assertTrue(vertx.verticleFactories().isEmpty());
assertFalse(vertx.verticleFactories().contains(fact1));
assertFalse(vertx.verticleFactories().contains(fact2));
}
use of io.vertx.core.spi.VerticleFactory in project vert.x by eclipse.
the class DeploymentManager method loadVerticleFactories.
private void loadVerticleFactories() {
Collection<VerticleFactory> factories = ServiceHelper.loadFactories(VerticleFactory.class);
factories.forEach(this::registerVerticleFactory);
VerticleFactory defaultFactory = new JavaVerticleFactory();
defaultFactory.init(vertx);
defaultFactories.add(defaultFactory);
}
use of io.vertx.core.spi.VerticleFactory in project vert.x by eclipse.
the class VerticleManager method loadVerticleFactories.
private void loadVerticleFactories() {
Collection<VerticleFactory> factories = ServiceHelper.loadFactories(VerticleFactory.class);
factories.forEach(this::registerVerticleFactory);
VerticleFactory defaultFactory = new JavaVerticleFactory();
defaultFactory.init(vertx);
defaultFactories.add(defaultFactory);
}
use of io.vertx.core.spi.VerticleFactory in project vert.x by eclipse.
the class VerticleFactoryTest method testRegisterTwice.
@Test
public void testRegisterTwice() {
VerticleFactory fact1 = new TestVerticleFactory("foo");
vertx.registerVerticleFactory(fact1);
try {
vertx.registerVerticleFactory(fact1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
// OK
}
}
use of io.vertx.core.spi.VerticleFactory in project vert.x by eclipse.
the class VerticleFactoryTest method testUnregisterNoFact.
@Test
public void testUnregisterNoFact() {
VerticleFactory fact1 = new TestVerticleFactory("foo");
try {
vertx.unregisterVerticleFactory(fact1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
// OK
}
}
Aggregations