Package com.mockobjects.servlet
Class MockHttpServletRequest
java.lang.Object
com.mockobjects.MockObject
com.mockobjects.servlet.MockHttpServletRequest
- All Implemented Interfaces:
Verifiable
- Version:
- $Revision: 1.16 $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExpectedGetAttributeName
(String anAttributeName) void
addExpectedSetAttribute
(String attributeName, Object attributeValue) getAttribute
(String anAttributeName) int
Cookie[]
long
getDateHeader
(String arg1) getHeaders
(String arg1) ServletInputStream
int
getIntHeader
(String arg1) getParameter
(String paramName) String[]
getParameterValues
(String key) getRealPath
(String arg1) RequestDispatcher
int
HttpSession
HttpSession
getSession
(boolean createSession) boolean
boolean
boolean
boolean
boolean
isSecure()
boolean
isUserInRole
(String arg1) void
removeAttribute
(String anAttributeToRemove) void
setAttribute
(String attributeName, Object attributeValue) void
void
setContentType
(String contentType) void
setExpectedContentType
(String aContentType) void
setExpectedCreateSession
(boolean createSession) void
void
setSession
(HttpSession httpSession) void
setupAddHeader
(String headerName, String value) void
setupAddParameter
(String paramName, String value) void
setupAddParameter
(String paramName, String[] values) void
setupGetAttribute
(Object anAttributeToReturn) void
setupGetAttrubuteNames
(Enumeration attributeNames) void
setupGetContentType
(String aContentType) void
setupGetContextPath
(String contextPath) void
setupGetInputStream
(ServletInputStream inputStream) void
setupGetMethod
(String aMethod) void
setupGetParameterMap
(Map map) void
void
setupGetProtocol
(String protocol) void
setupGetReader
(BufferedReader reader) void
setupGetRemoteAddr
(String remoteAddress) void
setupGetRequestDispatcher
(RequestDispatcher requestDispatcher) void
setupGetRequestURI
(String aRequestURI) void
setupGetServletPath
(String path) void
setupGetUserPrincipal
(Principal userPrincipal) void
setupPathInfo
(String pathInfo) void
setupQueryString
(String aQueryString) void
setupRemoveAttribute
(String anAttributeToRemove) void
setupScheme
(String aScheme) void
setupServerName
(String aServerName) Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
-
Constructor Details
-
MockHttpServletRequest
public MockHttpServletRequest()
-
-
Method Details
-
setupGetAttribute
-
addExpectedGetAttributeName
-
getAttribute
-
setupGetAttrubuteNames
-
getAttributeNames
-
getAuthType
-
getCharacterEncoding
-
getContentLength
public int getContentLength() -
getContentType
-
setupGetContentType
-
setExpectedContentType
-
setContentType
-
getContextPath
-
setupGetContextPath
-
getCookies
public Cookie[] getCookies() -
getDateHeader
-
getHeader
-
getHeaderNames
-
getHeaders
-
setupGetInputStream
public void setupGetInputStream(ServletInputStream inputStream) -
getInputStream
- Throws:
IOException
-
getIntHeader
-
getLocale
-
getLocales
-
setupGetMethod
-
getMethod
-
getParameter
-
setupGetParameterNames
-
getParameterNames
-
getParameterValues
-
getPathInfo
-
getPathTranslated
-
getProtocol
-
setupGetProtocol
-
getQueryString
-
getReader
-
setupGetReader
- Throws:
IOException
-
getRealPath
-
setupGetRemoteAddr
-
getRemoteAddr
-
getRemoteHost
-
getRemoteUser
-
setupGetRequestDispatcher
public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher) -
getRequestDispatcher
-
setExpectedRequestDispatcherURI
-
getRequestedSessionId
-
setupGetRequestURI
-
getRequestURI
-
getScheme
-
getServerName
-
getServerPort
public int getServerPort() -
setupGetServletPath
-
getServletPath
-
getSession
public HttpSession getSession() -
setSession
public void setSession(HttpSession httpSession) -
setExpectedCreateSession
public void setExpectedCreateSession(boolean createSession) -
getSession
public HttpSession getSession(boolean createSession) -
setupGetUserPrincipal
-
getUserPrincipal
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie() -
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl() -
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL() -
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid() -
isSecure
public boolean isSecure() -
isUserInRole
-
setupRemoveAttribute
-
removeAttribute
-
addExpectedSetAttribute
-
setAttribute
-
setupAddParameter
-
setupAddParameter
-
setupAddHeader
-
setupPathInfo
-
setupQueryString
-
setupScheme
-
setupServerName
-
getRequestURL
-
setCharacterEncoding
-
setupGetParameterMap
-
getParameterMap
-