| javax.servlet.jsp.PageContext org.apache.struts.mock.MockPageContext
MockPageContext | public class MockPageContext extends PageContext (Code) | | Mock ServletContext object for low-level unit tests of
Struts controller components. Coarser grained tests should be implemented
in terms of the Cactus framework, instead of the mock object classes.
WARNING - Only the minimal set of methods needed to
create unit tests is provided, plus additional methods to configure this
object as necessary. Methods for unsupported operations will throw
UnsupportedOperationException .
WARNING - Because unit tests operate in a single
threaded environment, no synchronization is performed.
version: $Rev: 471754 $ $Date: 2005-05-07 12:45:39 -0400 (Sat, 07 May 2005) version: $ |
Method Summary | |
public Object | findAttribute(String name) | public void | forward(String path) | public Object | getAttribute(String name) | public Object | getAttribute(String name, int scope) | public Enumeration | getAttributeNamesInScope(int scope) | public int | getAttributesScope(String name) | public Exception | getException() | public JspWriter | getOut() Custom JspWriter that throws the specified exception (supplied on
the constructor...if any), else it simply returns. | public Object | getPage() | public ServletRequest | getRequest() | public ServletResponse | getResponse() | public ServletConfig | getServletConfig() | public ServletContext | getServletContext() | public HttpSession | getSession() | public void | handlePageException(Exception e) | public void | handlePageException(Throwable t) | public void | include(String path) | public void | initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) | public JspWriter | popBody() | public BodyContent | pushBody() | public void | release() | public void | removeAttribute(String name) | public void | removeAttribute(String name, int scope) | public void | setAttribute(String name, Object value) | public void | setAttribute(String name, Object value, int scope) | public void | setValues(ServletConfig config, ServletRequest request, ServletResponse response) |
MockPageContext | public MockPageContext()(Code) | | |
MockPageContext | public MockPageContext(boolean throwIOException, boolean returnBody)(Code) | | Construct a new PageContext impl.
Parameters: throwIOException - Determines if the returned JspWriter shouldthrow an IOException on any method call. Parameters: returnBody - Determines if getOut() should return a newJspWriter or a BodyContent . |
getAttributesScope | public int getAttributesScope(String name)(Code) | | |
getOut | public JspWriter getOut()(Code) | | Custom JspWriter that throws the specified exception (supplied on
the constructor...if any), else it simply returns.
|
release | public void release()(Code) | | |
removeAttribute | public void removeAttribute(String name)(Code) | | |
removeAttribute | public void removeAttribute(String name, int scope)(Code) | | |
Methods inherited from javax.servlet.jsp.PageContext | abstract public void forward(String relativeUrlPath) throws ServletException, IOException(Code)(Java Doc) public ErrorData getErrorData()(Code)(Java Doc) abstract public Exception getException()(Code)(Java Doc) abstract public Object getPage()(Code)(Java Doc) abstract public ServletRequest getRequest()(Code)(Java Doc) abstract public ServletResponse getResponse()(Code)(Java Doc) abstract public ServletConfig getServletConfig()(Code)(Java Doc) abstract public ServletContext getServletContext()(Code)(Java Doc) abstract public HttpSession getSession()(Code)(Java Doc) abstract public void handlePageException(Exception e) throws ServletException, IOException(Code)(Java Doc) abstract public void handlePageException(Throwable t) throws ServletException, IOException(Code)(Java Doc) abstract public void include(String relativeUrlPath) throws ServletException, IOException(Code)(Java Doc) abstract public void include(String relativeUrlPath, boolean flush) throws ServletException, IOException(Code)(Java Doc) abstract public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException(Code)(Java Doc) public BodyContent pushBody()(Code)(Java Doc) abstract public void release()(Code)(Java Doc)
|
|
|