assertEquals("myos", tb.getTouchy());
}
public void testPropertyPlaceholderConfigurerWithOverridingSystemProperty() {
StaticApplicationContext ac = new StaticApplicationContext();
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.addPropertyValue("touchy", "${os.name}");
ac.registerSingleton("tb", TestBean.class, pvs);
pvs = new MutablePropertyValues();
Properties props = new Properties();
props.put("os.name", "myos");
pvs.addPropertyValue("properties", props);
pvs.addPropertyValue("systemPropertiesModeName", "SYSTEM_PROPERTIES_MODE_OVERRIDE");
ac.registerSingleton("configurer", PropertyPlaceholderConfigurer.class, pvs);
ac.refresh();
TestBean tb = (TestBean) ac.getBean("tb");
assertEquals(System.getProperty("os.name"), tb.getTouchy());
}