Package com.mockrunner.mock.web

Examples of com.mockrunner.mock.web.MockServletConfig


        assertTrue(handler instanceof MockRequestHandler);
    }

    public void testInitHessianService() throws Exception {

        MockServletConfig config = new MockServletConfig();
        config.setServletName("abc");

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);
        config.setInitParameter("extra-modules", ROPHessianServlet_ConfigModule.class
                .getName());

        ROPHessianServlet servlet = new ROPHessianServlet();

        servlet.init(config);
View Full Code Here


public class ROPHessianServletTest extends TestCase {

    public void testInitWithServletName() throws Exception {

        MockServletConfig config = new MockServletConfig();
        config
                .setServletName("cayenne-org.apache.cayenne.configuration.rop.server.test-config");

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();

        assertNull(WebUtil.getCayenneRuntime(context));
        servlet.init(config);
View Full Code Here

    }

    public void testInitWithLocation() throws Exception {

        String location = "cayenne-org.apache.cayenne.configuration.rop.server.test-config.xml";
        MockServletConfig config = new MockServletConfig();
        config.setServletName("abc");
        config.setInitParameter("configuration-location", location);

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
View Full Code Here

    public void testInitWithStandardModules() throws Exception {

        String name = "cayenne-org.apache.cayenne.configuration.rop.server.test-config";

        MockServletConfig config = new MockServletConfig();
        config.setServletName(name);

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
View Full Code Here

    public void testInitWithExtraModules() throws Exception {

        String name = "cayenne-org.apache.cayenne.configuration.rop.server.test-config";

        MockServletConfig config = new MockServletConfig();
        config.setServletName(name);
        config.setInitParameter("extra-modules", MockModule1.class.getName()
                + ","
                + MockModule2.class.getName());

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
View Full Code Here

    private void dispatch(HttpServletRequest request, HttpServletResponse response) throws Exception{
        //create an instance of the spring dispatcher
        ServletContext context = applicationContext.getServletContext();
       
        MockServletConfig config = new MockServletConfig();
        config.setServletContext(context);
        config.setServletName("dispatcher");
       
        DispatcherServlet dispatcher = new DispatcherServlet();
       
        dispatcher.setContextConfigLocation(GeoServerAbstractTestSupport.class.getResource("dispatcher-servlet.xml").toString());
        dispatcher.init(config);
View Full Code Here

        MockServletContext app = getMockFactory().getMockServletContext();
        app.addResourcePath("/WEB-INF/toolbox.xml","/WEB-INF/toolbox.xml");
        app.setResourceAsStream("/WEB-INF/toolbox.xml",
                new FileInputStream("./WEB-INF/toolbox.xml"));
       
        MockServletConfig config = getMockFactory().getMockServletConfig();
        config.setInitParameter(
                "org.apache.velocity.properties","WEB-INF/velocity.properties");      

        MapMessageResources resources = new MapMessageResources();
        resources.putMessages("WEB-INF/classes/ApplicationResources.properties");
        strutsModule.setResources(resources);
View Full Code Here

public class ROPHessianServletTest extends TestCase {

    public void testInitWithServletName() throws Exception {

        MockServletConfig config = new MockServletConfig();
        config
                .setServletName("cayenne-org.apache.cayenne.configuration.rop.server.test-config");

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();

        assertNull(WebUtil.getCayenneRuntime(context));
        servlet.init(config);
View Full Code Here

    }

    public void testInitWithLocation() throws Exception {

        String location = "cayenne-org.apache.cayenne.configuration.rop.server.test-config.xml";
        MockServletConfig config = new MockServletConfig();
        config.setServletName("abc");
        config.setInitParameter("configuration-location", location);

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
View Full Code Here

    public void testInitWithStandardModules() throws Exception {

        String name = "cayenne-org.apache.cayenne.configuration.rop.server.test-config";

        MockServletConfig config = new MockServletConfig();
        config.setServletName(name);

        MockServletContext context = new MockServletContext();
        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
View Full Code Here

TOP

Related Classes of com.mockrunner.mock.web.MockServletConfig

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.