Examples of MockServletConfig


Examples of com.mockobjects.servlet.MockServletConfig

    }

    @Override
    protected AbstractConfiguration getEmptyConfiguration()
    {
        return new ServletConfiguration(new MockServletConfig());
    }
View Full Code Here

Examples of com.mockobjects.servlet.MockServletConfig

                return parameters.keys();
            }
        };

        // create a servlet config
        final MockServletConfig config = new MockServletConfig();
        config.setServletContext(context);

        // create a servlet
        Servlet servlet = new HttpServlet()
        {
            /**
 
View Full Code Here

Examples of com.mockobjects.servlet.MockServletConfig

  public void testContextLoaderServletWithDefaultContext() throws Exception {
    MockServletContext sc = new MyServletContext(".");
    sc.setInitParameter(YanLoader.CONFIG_FILE_PARAM,
        "tests/jfun/yan/web/yan.xml");
    HttpServlet servlet = new YanLoaderServlet();
    MockServletConfig config = new MockServletConfig();
    config.setServletContext(sc);
    servlet.init(config);
    final BankAccount acct = verifyBean(sc, "account");
    servlet.destroy();
    assertTrue("Destroyed", acct.isDestroyed());
  }
View Full Code Here

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

Examples of com.mockrunner.mock.web.MockServletConfig

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

Examples of com.mockrunner.mock.web.MockServletConfig

    }

    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

Examples of com.mockrunner.mock.web.MockServletConfig

    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

Examples of com.mockrunner.mock.web.MockServletConfig

    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

Examples of com.mockrunner.mock.web.MockServletConfig

    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

Examples of com.mockrunner.mock.web.MockServletConfig

        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
TOP
Copyright © 2018 www.massapi.com. 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.