p.setProperty("wife.(class)", "org.springframework.beans.TestBean");
p.setProperty("wife.name", "kerry");
p.setProperty("kerry.(parent)", "wife");
p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
TestBean kerry1 = (TestBean) lbf.getBean("kerry");
TestBean kerry2 = (TestBean) lbf.getBean("kerry");
assertEquals("kerry", kerry1.getName());
assertNotNull("Non null", kerry1);
assertTrue("Singletons equal", kerry1 == kerry2);
lbf = new DefaultListableBeanFactory();
p = new Properties();
p.setProperty("wife.(class)", "org.springframework.beans.TestBean");
p.setProperty("wife.name", "kerry");
p.setProperty("wife.(singleton)", "false");
p.setProperty("kerry.(parent)", "wife");
p.setProperty("kerry.(singleton)", "false");
p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
assertFalse(lbf.isSingleton("kerry"));
kerry1 = (TestBean) lbf.getBean("kerry");
kerry2 = (TestBean) lbf.getBean("kerry");
assertTrue("Non null", kerry1 != null);
assertTrue("Prototypes NOT equal", kerry1 != kerry2);
lbf = new DefaultListableBeanFactory();
p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean");
p.setProperty("kerry.(singleton)", "true");
p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
kerry1 = (TestBean) lbf.getBean("kerry");
kerry2 = (TestBean) lbf.getBean("kerry");
assertTrue("Non null", kerry1 != null);
assertTrue("Specified singletons equal", kerry1 == kerry2);
}