|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.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 requestMethod 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 mappublic 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 mappublic void dispatch(String requestURI) throws IOException, javax.faces.FacesException
dispatch
in class javax.faces.context.ExternalContext
IOException
javax.faces.FacesException
public String encodeActionURL(String sb)
encodeActionURL
in class javax.faces.context.ExternalContext
public String encodeNamespace(String aValue)
encodeNamespace
in class javax.faces.context.ExternalContext
public String encodeResourceURL(String sb)
encodeResourceURL
in class javax.faces.context.ExternalContext
public Map getApplicationMap()
getApplicationMap
in class javax.faces.context.ExternalContext
public String getAuthType()
getAuthType
in class javax.faces.context.ExternalContext
public Object getContext()
getContext
in class javax.faces.context.ExternalContext
public String getInitParameter(String name)
getInitParameter
in class javax.faces.context.ExternalContext
public Map getInitParameterMap()
getInitParameterMap
in class javax.faces.context.ExternalContext
public String getRemoteUser()
getRemoteUser
in class javax.faces.context.ExternalContext
public Object getRequest()
getRequest
in class javax.faces.context.ExternalContext
public String getRequestContextPath()
getRequestContextPath
in class javax.faces.context.ExternalContext
public Map getRequestCookieMap()
getRequestCookieMap
in class javax.faces.context.ExternalContext
public Map getRequestHeaderMap()
getRequestHeaderMap
in class javax.faces.context.ExternalContext
public Map getRequestHeaderValuesMap()
getRequestHeaderValuesMap
in class javax.faces.context.ExternalContext
public Locale getRequestLocale()
getRequestLocale
in class javax.faces.context.ExternalContext
public Iterator getRequestLocales()
getRequestLocales
in class javax.faces.context.ExternalContext
public Map getRequestMap()
getRequestMap
in class javax.faces.context.ExternalContext
public Map getRequestParameterMap()
getRequestParameterMap
in class javax.faces.context.ExternalContext
public Iterator getRequestParameterNames()
getRequestParameterNames
in class javax.faces.context.ExternalContext
public Map getRequestParameterValuesMap()
getRequestParameterValuesMap
in class javax.faces.context.ExternalContext
public String getRequestPathInfo()
getRequestPathInfo
in class javax.faces.context.ExternalContext
public String getRequestServletPath()
getRequestServletPath
in class javax.faces.context.ExternalContext
public URL getResource(String path) throws MalformedURLException
getResource
in class javax.faces.context.ExternalContext
MalformedURLException
public InputStream getResourceAsStream(String path)
getResourceAsStream
in class javax.faces.context.ExternalContext
public Set getResourcePaths(String path)
getResourcePaths
in class javax.faces.context.ExternalContext
public Object getResponse()
getResponse
in class javax.faces.context.ExternalContext
public Object getSession(boolean create)
getSession
in class javax.faces.context.ExternalContext
public Map getSessionMap()
getSessionMap
in class javax.faces.context.ExternalContext
public Principal getUserPrincipal()
getUserPrincipal
in class javax.faces.context.ExternalContext
public boolean isUserInRole(String role)
isUserInRole
in class javax.faces.context.ExternalContext
public 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.ExternalContext
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |