|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.test.mock.MockHttpServletRequest
public class MockHttpServletRequest
Mock implementation of HttpServletContext
.
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
MockHttpServletRequest()
|
|
MockHttpServletRequest(HttpSession session)
|
|
MockHttpServletRequest(String contextPath,
String servletPath,
String pathInfo,
String queryString)
|
|
MockHttpServletRequest(String contextPath,
String servletPath,
String pathInfo,
String queryString,
HttpSession session)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockHttpServletRequest()
public MockHttpServletRequest(HttpSession session)
public MockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString)
public MockHttpServletRequest(String contextPath, String servletPath, String pathInfo, String queryString, HttpSession session)
Method Detail |
---|
public void addAttributeListener(ServletRequestAttributeListener listener)
Add a new listener instance that should be notified about attribute changes.
listener
- The new listener to registerpublic void addDateHeader(String name, long value)
Add a date-valued header for this request.
name
- Header namevalue
- Header valuepublic void addHeader(String name, String value)
Add a String-valued header for this request.
name
- Header namevalue
- Header valuepublic void addIntHeader(String name, int value)
Add an integer-valued header for this request.
name
- Header namevalue
- Header valuepublic void addParameter(String name, String value)
Add a request parameter for this request.
name
- Parameter namevalue
- Parameter valuepublic ServletContext getServletContext()
Return the ServletContext
associated with
this request.
public void setHttpSession(HttpSession session)
Set the HttpSession
associated with this request.
session
- The new sessionpublic void setLocale(Locale locale)
Set the Locale
associated with this request.
locale
- The new localepublic void setPathElements(String contextPath, String servletPath, String pathInfo, String queryString)
Set the parsed path elements associated with this request.
contextPath
- The context pathservletPath
- The servlet pathpathInfo
- The extra path informationqueryString
- The query stringpublic void setServletContext(ServletContext servletContext)
Set the ServletContext
associated with this request.
servletContext
- The new servlet contextpublic void setUserPrincipal(Principal principal)
Set the Principal
associated with this request.
principal
- The new Principalpublic String getAuthType()
getAuthType
in interface HttpServletRequest
public String getContextPath()
getContextPath
in interface HttpServletRequest
public Cookie[] getCookies()
getCookies
in interface HttpServletRequest
public long getDateHeader(String name)
getDateHeader
in interface HttpServletRequest
public String getHeader(String name)
getHeader
in interface HttpServletRequest
public Enumeration getHeaderNames()
getHeaderNames
in interface HttpServletRequest
public Enumeration getHeaders(String name)
getHeaders
in interface HttpServletRequest
public int getIntHeader(String name)
getIntHeader
in interface HttpServletRequest
public String getMethod()
getMethod
in interface HttpServletRequest
public String getPathInfo()
getPathInfo
in interface HttpServletRequest
public String getPathTranslated()
getPathTranslated
in interface HttpServletRequest
public String getQueryString()
getQueryString
in interface HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface HttpServletRequest
public String getRequestURI()
getRequestURI
in interface HttpServletRequest
public StringBuffer getRequestURL()
getRequestURL
in interface HttpServletRequest
public String getServletPath()
getServletPath
in interface HttpServletRequest
public HttpSession getSession()
getSession
in interface HttpServletRequest
public HttpSession getSession(boolean create)
getSession
in interface HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
in interface HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface HttpServletRequest
public boolean isUserInRole(String role)
isUserInRole
in interface HttpServletRequest
public Object getAttribute(String name)
getAttribute
in interface ServletRequest
public Enumeration getAttributeNames()
getAttributeNames
in interface ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface ServletRequest
public int getContentLength()
getContentLength
in interface ServletRequest
public String getContentType()
getContentType
in interface ServletRequest
public ServletInputStream getInputStream()
getInputStream
in interface ServletRequest
public Locale getLocale()
getLocale
in interface ServletRequest
public Enumeration getLocales()
getLocales
in interface ServletRequest
public String getLocalAddr()
getLocalAddr
in interface ServletRequest
public String getLocalName()
getLocalName
in interface ServletRequest
public int getLocalPort()
getLocalPort
in interface ServletRequest
public String getParameter(String name)
getParameter
in interface ServletRequest
public Map getParameterMap()
getParameterMap
in interface ServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface ServletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface ServletRequest
public String getProtocol()
getProtocol
in interface ServletRequest
public BufferedReader getReader()
getReader
in interface ServletRequest
public String getRealPath(String path)
getRealPath
in interface ServletRequest
public String getRemoteAddr()
getRemoteAddr
in interface ServletRequest
public String getRemoteHost()
getRemoteHost
in interface ServletRequest
public int getRemotePort()
getRemotePort
in interface ServletRequest
public RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
in interface ServletRequest
public String getScheme()
getScheme
in interface ServletRequest
public String getServerName()
getServerName
in interface ServletRequest
public int getServerPort()
getServerPort
in interface ServletRequest
public boolean isSecure()
isSecure
in interface ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface ServletRequest
public void setAttribute(String name, Object value)
setAttribute
in interface ServletRequest
public void setCharacterEncoding(String name)
setCharacterEncoding
in interface ServletRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |