|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.context.ExternalContext
org.apache.shale.test.mock.MockExternalContext
public class MockExternalContext
Mock implementation of ExternalContext.
| Field Summary | |
|---|---|
protected HttpServletRequest |
request
|
protected HttpServletResponse |
response
|
| Fields inherited from class javax.faces.context.ExternalContext |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
|---|---|
MockExternalContext(ServletContext context,
HttpServletRequest request,
HttpServletResponse response)
Construct a wrapper instance. |
|
| Methods inherited from class javax.faces.context.ExternalContext |
|---|
getRequestCharacterEncoding, getRequestContentType, getResponseCharacterEncoding, getResponseContentType, setRequest, setRequestCharacterEncoding, setResponse, setResponseCharacterEncoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HttpServletRequest request
protected HttpServletResponse response
| Constructor Detail |
|---|
public MockExternalContext(ServletContext context,
HttpServletRequest request,
HttpServletResponse response)
Construct a wrapper instance.
context - ServletContext for this applicationrequest - HttpServetRequest for this requestresponse - HttpServletResponse for this request| Method Detail |
|---|
public void addRequestCookieMap(Cookie cookie)
Add a new cookie for this request.
cookie - The new cookiepublic void setRequestCookieMap(Map map)
Set the request cookie map for this request.
map - The new request cookie map
public void addRequestParameterMap(String key,
String value)
Add the specified request parameter for this request.
key - Parameter namevalue - Parameter valuepublic void setRequestParameterMap(Map map)
Set the request parameter map for this request.
map - The new request parameter map
public void dispatch(String requestURI)
throws IOException,
javax.faces.FacesException
dispatch in class javax.faces.context.ExternalContextIOException
javax.faces.FacesExceptionpublic String encodeActionURL(String sb)
encodeActionURL in class javax.faces.context.ExternalContextpublic String encodeNamespace(String aValue)
encodeNamespace in class javax.faces.context.ExternalContextpublic String encodeResourceURL(String sb)
encodeResourceURL in class javax.faces.context.ExternalContextpublic Map getApplicationMap()
getApplicationMap in class javax.faces.context.ExternalContextpublic String getAuthType()
getAuthType in class javax.faces.context.ExternalContextpublic Object getContext()
getContext in class javax.faces.context.ExternalContextpublic String getInitParameter(String name)
getInitParameter in class javax.faces.context.ExternalContextpublic Map getInitParameterMap()
getInitParameterMap in class javax.faces.context.ExternalContextpublic String getRemoteUser()
getRemoteUser in class javax.faces.context.ExternalContextpublic Object getRequest()
getRequest in class javax.faces.context.ExternalContextpublic String getRequestContextPath()
getRequestContextPath in class javax.faces.context.ExternalContextpublic Map getRequestCookieMap()
getRequestCookieMap in class javax.faces.context.ExternalContextpublic Map getRequestHeaderMap()
getRequestHeaderMap in class javax.faces.context.ExternalContextpublic Map getRequestHeaderValuesMap()
getRequestHeaderValuesMap in class javax.faces.context.ExternalContextpublic Locale getRequestLocale()
getRequestLocale in class javax.faces.context.ExternalContextpublic Iterator getRequestLocales()
getRequestLocales in class javax.faces.context.ExternalContextpublic Map getRequestMap()
getRequestMap in class javax.faces.context.ExternalContextpublic Map getRequestParameterMap()
getRequestParameterMap in class javax.faces.context.ExternalContextpublic Iterator getRequestParameterNames()
getRequestParameterNames in class javax.faces.context.ExternalContextpublic Map getRequestParameterValuesMap()
getRequestParameterValuesMap in class javax.faces.context.ExternalContextpublic String getRequestPathInfo()
getRequestPathInfo in class javax.faces.context.ExternalContextpublic String getRequestServletPath()
getRequestServletPath in class javax.faces.context.ExternalContext
public URL getResource(String path)
throws MalformedURLException
getResource in class javax.faces.context.ExternalContextMalformedURLExceptionpublic InputStream getResourceAsStream(String path)
getResourceAsStream in class javax.faces.context.ExternalContextpublic Set getResourcePaths(String path)
getResourcePaths in class javax.faces.context.ExternalContextpublic Object getResponse()
getResponse in class javax.faces.context.ExternalContextpublic Object getSession(boolean create)
getSession in class javax.faces.context.ExternalContextpublic Map getSessionMap()
getSessionMap in class javax.faces.context.ExternalContextpublic Principal getUserPrincipal()
getUserPrincipal in class javax.faces.context.ExternalContextpublic boolean isUserInRole(String role)
isUserInRole in class javax.faces.context.ExternalContextpublic void log(String message)
log in class javax.faces.context.ExternalContext
public void log(String message,
Throwable throwable)
log in class javax.faces.context.ExternalContext
public void redirect(String requestURI)
throws IOException
redirect in class javax.faces.context.ExternalContextIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||