Search in sources :

Example 16 with ConfigView

use of org.wildfly.swarm.spi.api.config.ConfigView in project wildfly-swarm by wildfly-swarm.

the class ProjectStagesTest method testPropertyBasedConfigStagesFile.

@Test
public void testPropertyBasedConfigStagesFile() throws Exception {
    try {
        URL projectStages = getClass().getClassLoader().getResource("simple-project-stages.yml");
        System.setProperty(SwarmProperties.PROJECT_STAGE_FILE, projectStages.toExternalForm());
        Swarm swarm = new Swarm(new Properties());
        ConfigView view = swarm.configView();
        assertThat(view.resolve("foo.bar.baz").getValue()).isEqualTo("cheddar");
    } finally {
        System.clearProperty(SwarmProperties.PROJECT_STAGE_FILE);
    }
}
Also used : ConfigView(org.wildfly.swarm.spi.api.config.ConfigView) Properties(java.util.Properties) SwarmProperties(org.wildfly.swarm.spi.api.SwarmProperties) URL(java.net.URL) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)16 ConfigView (org.wildfly.swarm.spi.api.config.ConfigView)16 Properties (java.util.Properties)15 SwarmProperties (org.wildfly.swarm.spi.api.SwarmProperties)12 HashMap (java.util.HashMap)6 URL (java.net.URL)4 Archive (org.jboss.shrinkwrap.api.Archive)3 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)3 ConfigViewFactory (org.wildfly.swarm.container.config.ConfigViewFactory)3 DeploymentContext (org.wildfly.swarm.container.runtime.cdi.DeploymentContext)3 DeploymentContextImpl (org.wildfly.swarm.container.runtime.cdi.DeploymentContextImpl)3 AfterBeanDiscovery (javax.enterprise.inject.spi.AfterBeanDiscovery)1 BeanManager (javax.enterprise.inject.spi.BeanManager)1 StageConfig (org.wildfly.swarm.spi.api.StageConfig)1 CommonBean (org.wildfly.swarm.spi.api.cdi.CommonBean)1 ConfigKey (org.wildfly.swarm.spi.api.config.ConfigKey)1 SimpleKey (org.wildfly.swarm.spi.api.config.SimpleKey)1