Package org.apache.cactus

Examples of org.apache.cactus.JspTestCase


        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here


     * @see AbstractWebTestCaller#setTestCaseFields(AbstractTestCase)
     */
    protected void setTestCaseFields(AbstractTestCase theTestInstance)
        throws Exception
    {
        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------

        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------

        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request =
            jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().
            getField("pageContext");
        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------

        Field outField = jspInstance.getClass().getField("out");
        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            AbstractPageContextWrapper.newInstance(
                jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            AbstractPageContextWrapper.newInstance(jspImplicitObjects.
                getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

     * @see AbstractTestCaller#setTestCaseFields(AbstractTestCase)
     */
    protected void setTestCaseFields(AbstractTestCase theTestInstance)
        throws Exception
    {
        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------

        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------

        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request =
            jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().
            getField("pageContext");
        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------

        Field outField = jspInstance.getClass().getField("out");
        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

        if (!(theTestInstance instanceof JspTestCase))
        {
            return;
        }

        JspTestCase jspInstance = (JspTestCase) theTestInstance;
        JspImplicitObjects jspImplicitObjects =
            (JspImplicitObjects) this.webImplicitObjects;

        // Sets the Servlet-related implicit objects
        // -----------------------------------------
        super.setTestCaseFields(jspInstance);

        // Set the page context field of the test case class
        // -------------------------------------------------
        // Extract from the HTTP request the URL to simulate (if any)
        HttpServletRequest request = jspImplicitObjects.getHttpServletRequest();

        ServletURL url = ServletURL.loadFromRequest(request);

        Field pageContextField = jspInstance.getClass().getField("pageContext");

        pageContextField.set(jspInstance,
            new PageContextWrapper(jspImplicitObjects.getPageContext(), url));

        // Set the JSP writer field of the test case class
        // -----------------------------------------------
        Field outField = jspInstance.getClass().getField("out");

        outField.set(jspInstance, jspImplicitObjects.getJspWriter());
    }
View Full Code Here

TOP

Related Classes of org.apache.cactus.JspTestCase

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.