* @since 02.10.2003
*/
public class PropertyResourceConfigurerTests extends TestCase {
public void testPropertyOverrideConfigurer() {
StaticApplicationContext ac = new StaticApplicationContext();
ac.registerSingleton("tb1", TestBean.class);
ac.registerSingleton("tb2", TestBean.class);
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.addPropertyValue("properties", "tb1.age=99\ntb2.name=test");
ac.registerSingleton("configurer1", PropertyOverrideConfigurer.class, pvs);
pvs = new MutablePropertyValues();
pvs.addPropertyValue("properties", "tb2.age=99\ntb2.name=test2");
pvs.addPropertyValue("order", "0");
ac.registerSingleton("configurer2", PropertyOverrideConfigurer.class, pvs);
ac.refresh();
TestBean tb1 = (TestBean) ac.getBean("tb1");
TestBean tb2 = (TestBean) ac.getBean("tb2");
assertEquals(99, tb1.getAge());
assertEquals(99, tb2.getAge());
assertEquals(null, tb1.getName());
assertEquals("test", tb2.getName());
}