|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 register
public void addDateHeader(String name,
long value)
Add a date-valued header for this request.
name - Header namevalue - Header value
public void addHeader(String name,
String value)
Add a String-valued header for this request.
name - Header namevalue - Header value
public void addIntHeader(String name,
int value)
Add an integer-valued header for this request.
name - Header namevalue - Header value
public 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 locale
public 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 HttpServletRequestpublic String getContextPath()
getContextPath in interface HttpServletRequestpublic Cookie[] getCookies()
getCookies in interface HttpServletRequestpublic long getDateHeader(String name)
getDateHeader in interface HttpServletRequestpublic String getHeader(String name)
getHeader in interface HttpServletRequestpublic Enumeration getHeaderNames()
getHeaderNames in interface HttpServletRequestpublic Enumeration getHeaders(String name)
getHeaders in interface HttpServletRequestpublic int getIntHeader(String name)
getIntHeader in interface HttpServletRequestpublic String getMethod()
getMethod in interface HttpServletRequestpublic String getPathInfo()
getPathInfo in interface HttpServletRequestpublic String getPathTranslated()
getPathTranslated in interface HttpServletRequestpublic String getQueryString()
getQueryString in interface HttpServletRequestpublic String getRemoteUser()
getRemoteUser in interface HttpServletRequestpublic String getRequestedSessionId()
getRequestedSessionId in interface HttpServletRequestpublic String getRequestURI()
getRequestURI in interface HttpServletRequestpublic StringBuffer getRequestURL()
getRequestURL in interface HttpServletRequestpublic String getServletPath()
getServletPath in interface HttpServletRequestpublic HttpSession getSession()
getSession in interface HttpServletRequestpublic HttpSession getSession(boolean create)
getSession in interface HttpServletRequestpublic Principal getUserPrincipal()
getUserPrincipal in interface HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface HttpServletRequestpublic boolean isUserInRole(String role)
isUserInRole in interface HttpServletRequestpublic Object getAttribute(String name)
getAttribute in interface ServletRequestpublic Enumeration getAttributeNames()
getAttributeNames in interface ServletRequestpublic String getCharacterEncoding()
getCharacterEncoding in interface ServletRequestpublic int getContentLength()
getContentLength in interface ServletRequestpublic String getContentType()
getContentType in interface ServletRequestpublic ServletInputStream getInputStream()
getInputStream in interface ServletRequestpublic Locale getLocale()
getLocale in interface ServletRequestpublic Enumeration getLocales()
getLocales in interface ServletRequestpublic String getLocalAddr()
getLocalAddr in interface ServletRequestpublic String getLocalName()
getLocalName in interface ServletRequestpublic int getLocalPort()
getLocalPort in interface ServletRequestpublic String getParameter(String name)
getParameter in interface ServletRequestpublic Map getParameterMap()
getParameterMap in interface ServletRequestpublic Enumeration getParameterNames()
getParameterNames in interface ServletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface ServletRequestpublic String getProtocol()
getProtocol in interface ServletRequestpublic BufferedReader getReader()
getReader in interface ServletRequestpublic String getRealPath(String path)
getRealPath in interface ServletRequestpublic String getRemoteAddr()
getRemoteAddr in interface ServletRequestpublic String getRemoteHost()
getRemoteHost in interface ServletRequestpublic int getRemotePort()
getRemotePort in interface ServletRequestpublic RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface ServletRequestpublic String getScheme()
getScheme in interface ServletRequestpublic String getServerName()
getServerName in interface ServletRequestpublic int getServerPort()
getServerPort in interface ServletRequestpublic boolean isSecure()
isSecure in interface ServletRequestpublic void removeAttribute(String name)
removeAttribute in interface ServletRequest
public void setAttribute(String name,
Object value)
setAttribute in interface ServletRequestpublic void setCharacterEncoding(String name)
setCharacterEncoding in interface ServletRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||