* @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());
}