Search in sources :

Example 11 with AutoCloseableApp

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");
}
Also used : AutoCloseableApp(io.vertigo.app.AutoCloseableApp) Jedis(redis.clients.jedis.Jedis) RedisConnector(io.vertigo.commons.impl.connectors.redis.RedisConnector) Before(org.junit.Before)

Example 12 with AutoCloseableApp

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);
    }
}
Also used : AutoCloseableApp(io.vertigo.app.AutoCloseableApp) AppConfig(io.vertigo.app.config.AppConfig) Domain(io.vertigo.dynamo.domain.metamodel.Domain) Test(org.junit.Test)

Example 13 with AutoCloseableApp

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);
    }
}
Also used : AutoCloseableApp(io.vertigo.app.AutoCloseableApp) AppConfig(io.vertigo.app.config.AppConfig) DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) DynamoDefinitionProvider(io.vertigo.dynamo.plugins.environment.DynamoDefinitionProvider) Domain(io.vertigo.dynamo.domain.metamodel.Domain) Test(org.junit.Test)

Example 14 with AutoCloseableApp

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);
    }
}
Also used : AutoCloseableApp(io.vertigo.app.AutoCloseableApp) AppConfig(io.vertigo.app.config.AppConfig) DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) DynamoDefinitionProvider(io.vertigo.dynamo.plugins.environment.DynamoDefinitionProvider) Domain(io.vertigo.dynamo.domain.metamodel.Domain) Test(org.junit.Test)

Example 15 with AutoCloseableApp

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));
    }
}
Also used : AutoCloseableApp(io.vertigo.app.AutoCloseableApp) AppConfig(io.vertigo.app.config.AppConfig) FunctionManager(io.vertigo.core.spaces.component.data.FunctionManager) Test(org.junit.jupiter.api.Test)

Aggregations

AutoCloseableApp (io.vertigo.app.AutoCloseableApp)18 AppConfig (io.vertigo.app.config.AppConfig)11 Test (org.junit.jupiter.api.Test)8 LogConfig (io.vertigo.app.config.LogConfig)4 FunctionManager (io.vertigo.core.spaces.component.data.FunctionManager)4 Test (org.junit.Test)4 BioManager (io.vertigo.core.spaces.component.data.BioManager)3 MathPlugin (io.vertigo.core.spaces.component.data.MathPlugin)3 Domain (io.vertigo.dynamo.domain.metamodel.Domain)3 Before (org.junit.Before)3 BioManagerImpl (io.vertigo.core.spaces.component.data.BioManagerImpl)2 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)2 DynamoDefinitionProvider (io.vertigo.dynamo.plugins.environment.DynamoDefinitionProvider)2 XMLAppConfigBuilder (io.vertigo.app.config.xml.XMLAppConfigBuilder)1 RedisConnector (io.vertigo.commons.impl.connectors.redis.RedisConnector)1 Param (io.vertigo.core.param.Param)1 XmlParamPlugin (io.vertigo.core.plugins.param.xml.XmlParamPlugin)1 DummyPlugin (io.vertigo.core.spaces.component.data.DummyPlugin)1 StartedManager (io.vertigo.core.spaces.component.data.StartedManager)1 StartedManagerInitializer (io.vertigo.core.spaces.component.data.StartedManagerInitializer)1