Package org.apache.myfaces.test.mock

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


             * we can't get that out of the library and the resource name we set on this resource.
             */
            @Override
            public URL getURL()
            {
                MockServletContext servletContext
                        = (MockServletContext) FacesContext.getCurrentInstance()
                                .getExternalContext().getContext();
                servletContext.setDocumentRoot(new File("src/test/resources/org/apache/myfaces/application"));
   
                try
                {
                    return servletContext.getResource("/testlib/composite.xhtml");
                }
                catch (MalformedURLException e)
                {
                    return null;
                }
View Full Code Here


        }
    }

    protected void initServletObjects()
    {
        this.servletContext = new MockServletContext();
        this.servletConfig = new MockServletConfig(this.servletContext);
        applyContainerConfig();
    }
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);
       
View Full Code Here

             * we can't get that out of the library and the resource name we set on this resource.
             */
            @Override
            public URL getURL()
            {
                MockServletContext servletContext
                        = (MockServletContext) FacesContext.getCurrentInstance()
                                .getExternalContext().getContext();
                servletContext.setDocumentRoot(new File("src/test/resources/org/apache/myfaces/application"));
   
                try
                {
                    return servletContext.getResource("/testlib/composite.xhtml");
                }
                catch (MalformedURLException e)
                {
                    return null;
                }
View Full Code Here

     *
     * @throws Exception
     */
    protected void setUpServletObjects()
    {
        servletContext = new MockServletContext();
        servletConfig = new MockServletConfig(servletContext);
        servletContext.setDocumentRoot(getWebappContextURI());
        webContainer = new MockWebContainer();
        servletContext.setWebContainer(webContainer);
        setUpWebConfigParams();
View Full Code Here

     *
     * @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

     *
     * @throws Exception
     */
    protected void setUpServletObjects()
    {
        servletContext = new MockServletContext();
        servletConfig = new MockServletConfig(servletContext);
        servletContext.setDocumentRoot(getWebappContextURI());
        webContainer = new MockWebContainer();
        servletContext.setWebContainer(webContainer);
        setUpWebConfigParams();
View Full Code Here

        return Locale.getDefault();
    }

    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);
View Full Code Here

     *
     * @throws Exception
     */
    protected void setUpServletObjects() throws Exception
    {
        servletContext = new MockServletContext();
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setServletContext(servletContext);
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
View Full Code Here

     *
     * @throws Exception
     */
    protected void setUpServletObjects() throws Exception
    {
        servletContext = new MockServletContext();
        config = new MockServletConfig(servletContext);
        session = new MockHttpSession();
        session.setServletContext(servletContext);
        request = new MockHttpServletRequest(session);
        request.setServletContext(servletContext);
View Full Code Here

TOP

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

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.