Code example for MutablePropertyValues

Methods: add

0
	public void testPropertyPlaceholderConfigurerWithUnresolvableSystemPropertiesInLocation() { 
		StaticApplicationContext ac = new StaticApplicationContext();
		MutablePropertyValues pvs = new MutablePropertyValues();
		pvs.add("spouse", new RuntimeBeanReference("${ref}"));
		ac.registerSingleton("tb", TestBean.class, pvs);
		pvs = new MutablePropertyValues();
		pvs.add("location", "${myprop}/test/${myprop}");
		ac.registerSingleton("configurer", PropertyPlaceholderConfigurer.class, pvs);
		try { 
			ac.refresh();
			fail("Should have thrown BeanInitializationException"); 
		} 
		catch (BeanInitializationException ex) {
			// expected 
			assertTrue(ex.getMessage().contains("myprop"));
		} 
	} 
 
	@Test
	public void testPropertyPlaceholderConfigurerWithMultiLevelCircularReference() { 
Experience pair programming with AI  Get Codota for Java