Search in sources :

Example 1 with StartedManager

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

Aggregations

AutoCloseableApp (io.vertigo.app.AutoCloseableApp)1 AppConfig (io.vertigo.app.config.AppConfig)1 LogConfig (io.vertigo.app.config.LogConfig)1 StartedManager (io.vertigo.core.spaces.component.data.StartedManager)1 StartedManagerInitializer (io.vertigo.core.spaces.component.data.StartedManagerInitializer)1 Test (org.junit.jupiter.api.Test)1