public class InheritableBeanFactoryTests {
private XmlWebApplicationContext parentContext;
private XmlWebApplicationContext thisContext;
private void initContext(boolean withMockRequest) throws Exception {
ServletContext servletContext = new ServletRunner(new File(srcdir, "WEB-INF/web.xml"), "").newClient()
.newInvocation("http://localhost/servlet").getServlet().getServletConfig().getServletContext();
// parent context,如果withMockRequest,则注册并覆盖原有的request
parentContext = new XmlWebApplicationContext();
parentContext.setConfigLocation(withMockRequest ? "beans-autowire-parent.xml" : "beans.xml");