use of io.vertigo.core.spaces.component.data.BioManager in project vertigo by KleeGroup.
the class ComponentSpaceTest method testHome.
@Test
public void testHome() {
final AppConfig appConfig = AppConfig.builder().beginBoot().withLogConfig(new LogConfig("/log4j.xml")).endBoot().addModule(ModuleConfig.builder("Bio").addComponent(BioManager.class, BioManagerImpl.class).addComponent(MathManager.class, MathManagerImpl.class, Param.of("start", "100")).addPlugin(MathPlugin.class, Param.of("factor", "20")).build()).build();
try (AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final BioManager bioManager = app.getComponentSpace().resolve(BioManager.class);
final int res = bioManager.add(1, 2, 3);
assertEquals(366, res);
assertTrue(bioManager.isActive());
}
}
use of io.vertigo.core.spaces.component.data.BioManager in project vertigo by KleeGroup.
the class AppConfigTest method HomeTest.
@Test
public void HomeTest() {
final String locales = "fr_FR";
final AppConfig appConfig = AppConfig.builder().beginBoot().withLocales(locales).addPlugin(ClassPathResourceResolverPlugin.class).addPlugin(XmlParamPlugin.class, Param.of("url", "io/vertigo/app/config/xml2/basic-app-config.xml")).endBoot().addModule(ModuleConfig.builder("bio").addComponent(BioManager.class, BioManagerImpl.class).addComponent(MathManager.class, MathManagerImpl.class, Param.of("start", "${math.test.start}")).addPlugin(MathPlugin.class, Param.of("factor", "20")).build()).build();
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());
}
}
use of io.vertigo.core.spaces.component.data.BioManager 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