org.chwf.servlet.mock
Class MockPageContext

java.lang.Object
  |
  +--javax.servlet.jsp.PageContext
        |
        +--org.chwf.servlet.mock.MockPageContext

public class MockPageContext
extends javax.servlet.jsp.PageContext

Mock page context.

Author:
Paul Strack

Fields inherited from class javax.servlet.jsp.PageContext
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE
 
Constructor Summary
MockPageContext()
           
 
Method Summary
 java.lang.Object findAttribute(java.lang.String name)
          Find attribute by searching all scopes.
 void forward(java.lang.String uri)
          Unsupported.
 java.lang.Object getAttribute(java.lang.String name)
          Get attribute.
 java.lang.Object getAttribute(java.lang.String name, int scope)
          Get attribute.
 java.util.Enumeration getAttributeNamesInScope(int scope)
          Unsupported.
 int getAttributesScope(java.lang.String name)
          Unsupported.
 java.lang.Exception getException()
          Unsupported.
 javax.servlet.jsp.JspWriter getOut()
          MockJspWriter
 java.lang.Object getPage()
          Unsupported.
 javax.servlet.ServletRequest getRequest()
          MockServletRequest.
 javax.servlet.ServletResponse getResponse()
          MockServletRequest
 javax.servlet.ServletConfig getServletConfig()
          MockServletConfig
 javax.servlet.ServletContext getServletContext()
          MockServletContext
 javax.servlet.http.HttpSession getSession()
          MockSession.
 void handlePageException(java.lang.Exception ex)
          Unsupported.
 void handlePageException(java.lang.Throwable ex)
          Unsupported.
 void include(java.lang.String uri)
          Unsupported.
 void initialize(javax.servlet.Servlet arg0, javax.servlet.ServletRequest arg1, javax.servlet.ServletResponse arg2, java.lang.String arg3, boolean arg4, int arg5, boolean arg6)
          Unsupported.
 void release()
          Unsupported.
 void removeAttribute(java.lang.String name)
          Remove attribute.
 void removeAttribute(java.lang.String name, int scope)
          Remove attribute.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set attribute.
 void setAttribute(java.lang.String name, java.lang.Object value, int scope)
          Set attribute.
 
Methods inherited from class javax.servlet.jsp.PageContext
popBody, pushBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockPageContext

public MockPageContext()
Method Detail

initialize

public void initialize(javax.servlet.Servlet arg0,
                       javax.servlet.ServletRequest arg1,
                       javax.servlet.ServletResponse arg2,
                       java.lang.String arg3,
                       boolean arg4,
                       int arg5,
                       boolean arg6)
                throws java.io.IOException,
                       java.lang.IllegalStateException,
                       java.lang.IllegalArgumentException
Unsupported. Mock objects initialized when PageContext is created.
Overrides:
initialize in class javax.servlet.jsp.PageContext
Parameters:
arg0 - arg
arg1 - arg
arg2 - arg
arg3 - arg
arg4 - arg
arg5 - arg
arg6 - arg
Throws:
java.io.IOException - for errors
java.lang.IllegalStateException - for errors
java.lang.IllegalArgumentException - for errors

release

public void release()
Unsupported.
Overrides:
release in class javax.servlet.jsp.PageContext
See Also:
PageContext.release()

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Set attribute.
Overrides:
setAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
value - value
See Also:
PageContext.setAttribute(String, Object)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value,
                         int scope)
Set attribute.
Overrides:
setAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
value - value
scope - scope
See Also:
PageContext.setAttribute(String, Object, int)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Get attribute.
Overrides:
getAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
Returns:
value
See Also:
PageContext.getAttribute(String)

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     int scope)
Get attribute.
Overrides:
getAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
scope - scope
Returns:
value
See Also:
PageContext.getAttribute(String, int)

findAttribute

public java.lang.Object findAttribute(java.lang.String name)
Find attribute by searching all scopes.
Overrides:
findAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
Returns:
value
See Also:
PageContext.findAttribute(String)

removeAttribute

public void removeAttribute(java.lang.String name)
Remove attribute.
Overrides:
removeAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
See Also:
PageContext.removeAttribute(String)

removeAttribute

public void removeAttribute(java.lang.String name,
                            int scope)
Remove attribute.
Overrides:
removeAttribute in class javax.servlet.jsp.PageContext
Parameters:
name - name
scope - scope
See Also:
PageContext.removeAttribute(String, int)

getAttributesScope

public int getAttributesScope(java.lang.String name)
Unsupported.
Overrides:
getAttributesScope in class javax.servlet.jsp.PageContext
Parameters:
name - name
Returns:
scope
See Also:
PageContext.getAttributesScope(String)

getAttributeNamesInScope

public java.util.Enumeration getAttributeNamesInScope(int scope)
Unsupported.
Overrides:
getAttributeNamesInScope in class javax.servlet.jsp.PageContext
Parameters:
scope - scope
Returns:
names
See Also:
PageContext.getAttributeNamesInScope(int)

getOut

public javax.servlet.jsp.JspWriter getOut()
MockJspWriter
Overrides:
getOut in class javax.servlet.jsp.PageContext
Returns:
out
See Also:
PageContext.getOut()

getSession

public javax.servlet.http.HttpSession getSession()
MockSession.
Overrides:
getSession in class javax.servlet.jsp.PageContext
Returns:
session.
See Also:
PageContext.getSession()

getPage

public java.lang.Object getPage()
Unsupported.
Overrides:
getPage in class javax.servlet.jsp.PageContext
Returns:
page.
See Also:
PageContext.getPage()

getRequest

public javax.servlet.ServletRequest getRequest()
MockServletRequest.
Overrides:
getRequest in class javax.servlet.jsp.PageContext
Returns:
request.
See Also:
PageContext.getRequest()

getResponse

public javax.servlet.ServletResponse getResponse()
MockServletRequest
Overrides:
getResponse in class javax.servlet.jsp.PageContext
Returns:
response.
See Also:
PageContext.getResponse()

getException

public java.lang.Exception getException()
Unsupported.
Overrides:
getException in class javax.servlet.jsp.PageContext
Returns:
exception
See Also:
PageContext.getException()

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
MockServletConfig
Overrides:
getServletConfig in class javax.servlet.jsp.PageContext
Returns:
config
See Also:
PageContext.getServletConfig()

getServletContext

public javax.servlet.ServletContext getServletContext()
MockServletContext
Overrides:
getServletContext in class javax.servlet.jsp.PageContext
Returns:
context
See Also:
PageContext.getServletContext()

forward

public void forward(java.lang.String uri)
             throws javax.servlet.ServletException,
                    java.io.IOException
Unsupported.
Overrides:
forward in class javax.servlet.jsp.PageContext
Parameters:
uri -  
See Also:
PageContext.forward(String)

include

public void include(java.lang.String uri)
             throws javax.servlet.ServletException,
                    java.io.IOException
Unsupported.
Overrides:
include in class javax.servlet.jsp.PageContext
Parameters:
uri -  
See Also:
PageContext.include(String)

handlePageException

public void handlePageException(java.lang.Exception ex)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Unsupported.
Overrides:
handlePageException in class javax.servlet.jsp.PageContext
Parameters:
ex -  
Throws:
javax.servlet.ServletException -  
java.io.IOException -  
See Also:
PageContext

handlePageException

public void handlePageException(java.lang.Throwable ex)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Unsupported.
Parameters:
ex -  
Throws:
javax.servlet.ServletException -  
java.io.IOException -  
See Also:
PageContext


Copyright © 2002-2004, Paul Strack. All Rights Reserved.