public void testIntegration() throws Exception
{
MockControl contextControl = newControl(ServletContext.class);
ServletContext context = (ServletContext) contextControl.getMock();
HttpServlet servlet = new ServletFixture();
// Create a non-strict control
MockControl configControl = MockControl.createControl(ServletConfig.class);
addControl(configControl);
ServletConfig config = (ServletConfig) configControl.getMock();
config.getInitParameter(ApplicationSpecificationInitializer.APP_SPEC_PATH_PARAM);
configControl.setReturnValue(null);
config.getServletContext();
configControl.setReturnValue(context, 3);
config.getServletName();
configControl.setReturnValue("dino", 2);
context.log("dino: init");
context.getResource("/WEB-INF/dino/dino.application");
contextControl.setReturnValue(getClass().getResource("ParseApp.application"), 2);
replayControls();
servlet.init(config);
Registry registry = RegistryBuilder.constructDefaultRegistry();
ApplicationInitializer ai = (ApplicationInitializer) registry.getService(
"tapestry.init.ApplicationSpecificationInitializer",