use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class AccountManagerTest method setUp.
@Before
public void setUp() {
app = new AutoCloseableApp(MyAppConfig.config(redis, database));
DIInjector.injectMembers(this, app.getComponentSpace());
if (redis) {
final RedisConnector redisConnector = app.getComponentSpace().resolve(RedisConnector.class);
try (final Jedis jedis = redisConnector.getResource()) {
jedis.flushAll();
}
}
if (database) {
CreateTestDataBase.initMainStore();
}
accountURI0 = createAccountURI("0");
accountURI1 = createAccountURI("1");
accountURI2 = createAccountURI("2");
groupURI = createGroupURI("100");
groupAllURI = createGroupURI("ALL");
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class MultiResourcesEnvironmentManagerTest method testFirst.
//
// <module name="test-2"><!-- this moduleReference -->
// <resource type ="classes" path="io.vertigo.dynamock.domain.DtDefinitions"/>
// </module>
@Test
public void testFirst() {
final AppConfig appConfig = prepareDefaultAppConfigBuilder().addModule(ModuleConfig.builder("myApp").addDefinitionProvider(DefinitionProviderConfig.builder(DynamoDefinitionProvider.class).addDefinitionResource("kpr", "io/vertigo/dynamo/environment/multi/data/execution.kpr").build()).build()).build();
try (final AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final Domain doString = app.getDefinitionSpace().resolve("DO_STRING", Domain.class);
Assert.assertNotNull(doString);
}
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class MultiResourcesEnvironmentManagerTest method testMergedResources.
@Test
public void testMergedResources() {
final AppConfig appConfig = prepareDefaultAppConfigBuilder().addModule(ModuleConfig.builder("myApp").addDefinitionProvider(DefinitionProviderConfig.builder(DynamoDefinitionProvider.class).addDefinitionResource("kpr", "io/vertigo/dynamo/environment/multi/data/execution.kpr").addDefinitionResource("classes", DtDefinitions.class.getCanonicalName()).build()).build()).build();
try (final AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final Domain doString = app.getDefinitionSpace().resolve("DO_STRING", Domain.class);
Assert.assertNotNull(doString);
final DtDefinition dtItem = app.getDefinitionSpace().resolve("DT_ITEM", DtDefinition.class);
Assert.assertNotNull(dtItem);
}
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class MultiResourcesEnvironmentManagerTest method testSplittedModules.
@Test
public void testSplittedModules() {
final AppConfig appConfig = prepareDefaultAppConfigBuilder().addModule(ModuleConfig.builder("myApp").addDefinitionProvider(DefinitionProviderConfig.builder(DynamoDefinitionProvider.class).addDefinitionResource("kpr", "io/vertigo/dynamo/environment/multi/data/execution.kpr").addDefinitionResource("classes", DtDefinitions.class.getCanonicalName()).build()).build()).build();
try (final AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final Domain doString = app.getDefinitionSpace().resolve("DO_STRING", Domain.class);
Assert.assertNotNull(doString);
final DtDefinition dtItem = app.getDefinitionSpace().resolve("DT_ITEM", DtDefinition.class);
Assert.assertNotNull(dtItem);
}
}
use of io.vertigo.app.AutoCloseableApp in project vertigo by KleeGroup.
the class ComponentSpace3Test method testInjectPluginsAttributeOrder.
@Test
public void testInjectPluginsAttributeOrder() {
final AppConfig appConfig = createHomeWithInjectPluginsAttribute(false);
try (AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final FunctionManager functionManager = app.getComponentSpace().resolve(FunctionManager.class);
assertEquals(26, functionManager.computeAll(3));
}
}
Aggregations