List of usage examples for java.lang System getenv
public static String getenv(String name)
From source file:com.indeed.iupload.web.WebAppInitializer.java
protected boolean isDeveloperStationEnvironment() { final String env = System.getenv("SPRING_PROFILES_DEFAULT"); return "developer".equals(env); }
From source file:org.greencheek.utils.environment.propertyplaceholder.spring.TestEnvironmentalPropertySourcesPlaceholderConfigurerWithSpringValueResolution.java
@Test public void testPropertyResolvedNoSystemProperties() { System.setProperty("ENVIRONMENT", "dev"); System.setProperty("ENV", "dev"); ctx = new ClassPathXmlApplicationContext( new String[] { "classpath:SpringValueResolution-NoSysProps-config.xml" }); String value = (String) ctx.getBean("string"); String valueSys = (String) ctx.getBean("string-sys"); String valueEnv = (String) ctx.getBean("string-env"); assertEquals("devproperties", value); assertEquals("${ENVIRONMENT}", valueSys); assertEquals(System.getenv("PATH"), valueEnv); ctx.close();/* w w w . ja va 2s. c om*/ }