Package org.constretto.spring.factorybean.helper

Examples of org.constretto.spring.factorybean.helper.EnvironmentService


public class ConstrettoSingletonFactoryBeanTest extends AbstractJUnit4SpringContextTests {

    @Test(expected = BeanCreationException.class)
    public void givenNoStageOnStartupAndNoDefaultThenThenThrowBeanCreationException() throws Exception {
        System.clearProperty(ASSEMBLY_KEY);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBean");
    }
View Full Code Here


    }

    @Test
    public void givenNoStageOnStartupWithDefaultThenDefaultBeanIsSelected() throws Exception {
        System.clearProperty(ASSEMBLY_KEY);
        EnvironmentService testBeanOverriddenDefaultPrefix = (EnvironmentService) applicationContext
                .getBean("testBeanOverriddenDefaultBean");
        assertEquals(DevelopmentTestBean.class, testBeanOverriddenDefaultPrefix.getClass());
    }
View Full Code Here

    }

    @Test
    public void givenDevelopmentStageOnStartupThenDevelopmentBeanIsSelected() throws Exception {
        System.setProperty(ASSEMBLY_KEY, DEVELOPMENT);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBean");
        assertEquals(DevelopmentTestBean.class, testBean.getClass());
    }
View Full Code Here

    }

    @Test
    public void givenDevelopmentFirstStageOnStartupThenDevelopmentBeanIsSelected() throws Exception {
        System.setProperty(ASSEMBLY_KEY, DEVELOPMENT + "," + PRODUCTION);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBean");
        assertEquals(DevelopmentTestBean.class, testBean.getClass());
    }
View Full Code Here

    }

    @Test
    public void givenProductionFirstStageOnStartupThenProductionBeanIsSelected() throws Exception {
        System.setProperty(ASSEMBLY_KEY, PRODUCTION + "," + DEVELOPMENT);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBean");
        assertEquals(ProductionTestBean.class, testBean.getClass());
    }
View Full Code Here

    }

    @Test(expected = BeanCreationException.class)
    public void givenUnknownStageOnStartupAndNoDefaultThenThrowBeanCreationException() throws Exception {
        System.setProperty(ASSEMBLY_KEY, TEST);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBean");
        assertEquals(DevelopmentTestBean.class, testBean.getClass());
    }
View Full Code Here

    }

    @Test
    public void givenUnknownStageOnStartupWithDefaultThenDefaultIsSelected() throws Exception {
        System.setProperty(ASSEMBLY_KEY, TEST);
        EnvironmentService testBean = (EnvironmentService) applicationContext.getBean("testBeanOverriddenDefaultBean");
        assertEquals(DevelopmentTestBean.class, testBean.getClass());
    }
View Full Code Here

TOP

Related Classes of org.constretto.spring.factorybean.helper.EnvironmentService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.