use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class ComponentSpace3Test method testInjectPluginsConstructorOrder.
@Test
public void testInjectPluginsConstructorOrder() {
final AppConfig appConfig = createHomeWithInjectPluginsConstructor(false);
try (AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final FunctionManager functionManager = app.getComponentSpace().resolve(FunctionManager.class);
assertEquals(26, functionManager.computeAll(3));
}
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class ComponentSpace4Test method testStartedComponent.
@Test
public void testStartedComponent() {
final AppConfig appConfig = AppConfig.builder().beginBoot().withLogConfig(new LogConfig("/log4j.xml")).endBoot().addModule(ModuleConfig.builder("Started").addComponent(StartedManager.class, StartedManagerImpl.class).build()).addInitializer(StartedManagerInitializer.class).build();
final StartedManager startedManager;
try (AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
startedManager = app.getComponentSpace().resolve(StartedManager.class);
assertTrue(startedManager.isInitialized(), "Component StartedManager not Initialized");
assertTrue(startedManager.isStarted(), "Component StartedManager not Started");
assertTrue(startedManager.isAppPreActivated(), "Component StartedManager not PostStarted");
}
assertFalse(startedManager.isStarted(), "Component StartedManager not Stopped");
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class AppConfig2Test method testBioManager.
private void testBioManager(final AppConfig appConfig) {
try (AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
assertEquals(app, app);
assertTrue(app.getComponentSpace().contains("bioManager"));
final BioManager bioManager = app.getComponentSpace().resolve(BioManager.class);
final int res = bioManager.add(1, 2, 3);
assertEquals(366, res);
assertTrue(bioManager.isActive());
}
}
Aggregations