Code example for MutablePropertyValues

Methods: addPropertyValue

0
    } 
 
    @Test(expected = BeanCreationException.class)
    public void simpleNegativeCaseResourceDoesNotExist() { 
        StaticApplicationContext c = new StaticApplicationContext();
        MutablePropertyValues pvs = new MutablePropertyValues();
        pvs.addPropertyValue("path", "classpath:asdf.xml");
        c.registerSingleton("myResource", ResourcePathFactoryBean.class, pvs);
        c.refresh();
 
        // From the spring app context this value should come out as a string 
        c.getBean("myResource");
    } 
 
    @Test(expected = BeanCreationException.class)
    public void nullOrEmptyValueforPath() { 
        StaticApplicationContext c = new StaticApplicationContext();
        c.registerSingleton("myResource", ResourcePathFactoryBean.class);
        c.refresh();