Examples of MockServletConfig


Examples of com.sun.faces.mock.MockServletConfig

       
        // Set up Servlet API Objects
        servletContext = new MockServletContext();
        servletContext.addInitParameter("appParamName", "appParamValue");
        servletContext.setAttribute("appScopeName", "appScopeValue");
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setAttribute("sesScopeName", "sesScopeValue");
        request = new MockHttpServletRequest(session);
        request.setAttribute("reqScopeName", "reqScopeValue");
        response = new MockHttpServletResponse();
View Full Code Here

Examples of com.vaadin.server.MockServletConfig

     *
     */
    @Before
    public void initMockStuff() throws ServiceException, ServletException {
        mockServlet = new VaadinServlet();
        mockServlet.init(new MockServletConfig());
        mockDeploymentConfiguration = new MockDeploymentConfiguration();

        mockService = new VaadinServletService(mockServlet,
                mockDeploymentConfiguration);

View Full Code Here

Examples of com.vaadin.server.MockServletConfig

    }

    private LegacyCommunicationManager createCommunicationManager()
            throws Exception {
        VaadinServlet servlet = new VaadinServlet();
        servlet.init(new MockServletConfig());
        VaadinServletService vss = new VaadinServletService(servlet,
                new MockDeploymentConfiguration());
        servlet.init(new MockServletConfig());
        return new LegacyCommunicationManager(
                new AlwaysLockedVaadinSession(vss));
    }
View Full Code Here

Examples of net.sf.jsptest.compiler.jsp20.mock.MockServletConfig

        assertTrue("Source file " + new File(info.getJspSource()).getAbsolutePath()
                + " does not exist", new File(info.getJspSource()).exists());
        PrintWriter logWriter = new PrintWriter(new StringWriter());
        URL baseUrl = new File(info.getWebRoot()).toURL();
        ServletContext sContext = new JspCServletContext(logWriter, baseUrl);
        ServletConfig sConfig = new MockServletConfig(sContext);
        Options options = createOptions(sContext, sConfig, info);
        JspRuntimeContext rtContext = new JspRuntimeContext(sContext, options);
        JspServletWrapper sWrapper = makeWrapper(sContext, options, rtContext);
        JspCompilationContext cContext = createJspCompilationContext(info, sContext, options,
                rtContext, sWrapper, new StringWriter());
View Full Code Here

Examples of net.sourceforge.cruisecontrol.mock.MockServletConfig

    protected void tearDown() {
        servlet = null;
    }

    public void testGetRootDir() {
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        config.setServletContext(context);
       
        try {
            servlet.getRootDir(config);
            fail("should have exception when required attributes not set");
        } catch (ServletException e) {
        }

        config.setInitParameter("rootDir", ".");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("shouldn't throw exception when valid rootDir parameter set");
        }
       
        context.setInitParameter("logDir", "this directory does not exist");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("good rootDir but bad logDir should work");
        }
       
        config = new MockServletConfig();
        context = new MockServletContext();
        config.setServletContext(context);

        context.setInitParameter("logDir", ".");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("shouldn't throw exception when valid logDir parameter set");
        }
       
        config.setInitParameter("rootDir", "this directory does not exist");
        try {
            servlet.getRootDir(config);
        } catch (ServletException e) {
            fail("bad rootDir but good logDir should work");
        }
View Full Code Here

Examples of org.apache.click.servlet.MockServletConfig

            getServletContext().setWebappPath(webappPath);

            if (getServletConfig() == null) {
                String servletName = "click-servlet";
                setServletConfig(new MockServletConfig(servletName,
                    getServletContext()));
            }

            if (getClickServlet() == null) {
                this.setClickServlet(new ClickServlet());
View Full Code Here

Examples of org.apache.click.servlet.MockServletConfig

        if (locale == null) {
            throw new IllegalArgumentException("Locale cannot be null");
        }
        MockServletContext servletContext = new MockServletContext();
        String servletName = "click-servlet";
        MockServletConfig servletConfig = new MockServletConfig(servletName,
            servletContext);

        ClickServlet servlet = new ClickServlet();

        MockResponse response = new MockResponse();
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockServletConfig

    }

    protected void initServletObjects()
    {
        this.servletContext = new MockServletContext();
        this.servletConfig = new MockServletConfig(this.servletContext);
        applyContainerConfig();
    }
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockServletConfig

    }

    protected void initServletObjects() throws Exception
    {
        servletContext = new MockServletContext();
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setServletContext(servletContext);
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
        response = new MockHttpServletResponse();
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockServletConfig

     * @throws Exception
     */
    protected void setUpServletObjects() throws Exception
    {
        servletContext = new MockServletContext();
        servletConfig = new MockServletConfig(servletContext);
        servletContext.setDocumentRoot(getWebappContextURI());
        webContainer = new MockWebContainer();
        servletContext.setWebContainer(webContainer);
        setUpWebConfigParams();
    }
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.