Package org.impalaframework.spring.module.impl

Examples of org.impalaframework.spring.module.impl.Parent


            }
        };
       
        parentContext.getBean("parent");
       
        Parent parentBean = (Parent) parentContext.getBean("parent");
        Child child = parentBean.tryGetChild();

        try {
            child.childMethod();
            fail();
        }
View Full Code Here


public class SimpleParentContextTest extends TestCase {
   
    public void testContexts() {
       
        ClassPathXmlApplicationContext parent = new ClassPathXmlApplicationContext("childcontainer/parent-context.xml");
        Parent parentBean = (Parent) parent.getBean("parent");

        // this fails because there is no child context
        try {
            parentBean.tryGetChild();
            fail();
        }
        catch (NoSuchBeanDefinitionException e) {
        }

        ClassPathXmlApplicationContext child = new ClassPathXmlApplicationContext(
                new String[] { "childcontainer/child-context.xml" }, parent);
        Child childBean = (Child) child.getBean("child");

        // show that we've overridden the child
        Parent gotParent = childBean.tryGetParent();
        assertSame(parentBean, gotParent);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.spring.module.impl.Parent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.