Package org.apache.myfaces.test.mock

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


    protected void setUpServletRequestAndResponse() throws Exception
    {
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
        response = new MockHttpServletResponse();
    }
View Full Code Here


            parameters.put(command.getClientId(), value == null ? "" : value.toString());
            if (facesContext.getExternalContext().getClientWindow() != null)
            {
                parameters.put(ResponseStateManager.CLIENT_WINDOW_URL_PARAM, facesContext.getExternalContext().getClientWindow().getId());
            }
            MockHttpServletResponse response = (MockHttpServletResponse) facesContext.getExternalContext().getResponse();
            Cookie cookie = response.getCookie("oam.Flash.RENDERMAP.TOKEN");
            getCookies().put("oam.Flash.RENDERMAP.TOKEN", cookie);
        }
    }
View Full Code Here

        if (resetValues)
        {
            parameters.put("javax.faces.partial.resetValues", "true");
        }
       
        MockHttpServletResponse response = (MockHttpServletResponse) facesContext.getExternalContext().getResponse();
        Cookie cookie = response.getCookie("oam.Flash.RENDERMAP.TOKEN");
        getCookies().put("oam.Flash.RENDERMAP.TOKEN", cookie);
       
        headers.put("Faces-Request", "partial/ajax");
        headers.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    }
View Full Code Here

        };
       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "false");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
   
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                commandButton, facesContext, writer, attrs);
View Full Code Here

           };
       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "true");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                commandButton, facesContext, writer, attrs);
View Full Code Here

      this.config = new MockServletConfig(this.servletContext);
      this.session = new MockHttpSession();
      this.session.setServletContext(this.servletContext);
      this.request = new MockHttpServletRequest(this.session);
      this.request.setServletContext(this.servletContext);
      this.response = new MockHttpServletResponse();

      // Set up JSF API Objects
      FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY, MockApplicationFactory.class.getName());
      FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY, MockBaseFacesContextFactory.class.getName());
      FactoryFinder.setFactory(FactoryFinder.LIFECYCLE_FACTORY, MockLifecycleFactory.class.getName());
View Full Code Here

        commandLink.setValue("outputdata");
       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "false");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                commandLink, facesContext, writer, attrs);
View Full Code Here

       
        // create new request, response, ExternalContext and FacesContext
        // to simulate a new request
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
        response = new MockHttpServletResponse();
        setUpExternalContext();
        setUpFacesContext();
       
        // add the cookie to the new request
        request.addCookie(renderTokenCookie);
View Full Code Here

       
        // create new request, response, ExternalContext and FacesContext
        // to simulate a new request
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
        response = new MockHttpServletResponse();
        setUpExternalContext();
        setUpFacesContext();
       
        // add the cookie to the new request
        request.addCookie(renderTokenCookie);
View Full Code Here

           };
       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "true");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                commandButton, facesContext, writer, attrs);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.test.mock.MockHttpServletResponse

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.