Package com.mockobjects.servlet

# Class MockHttpServletRequest

java.lang.Object
com.mockobjects.MockObject
com.mockobjects.servlet.MockHttpServletRequest

All Implemented Interfaces:
  `Verifiable`

public class MockHttpServletRequest extends MockObject

Version:
  $Revision: 1.16 $

## Constructor Summary

Constructors
Constructor
Description
`MockHttpServletRequest()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addExpectedGetAttributeName(String anAttributeName)`
`void`
`addExpectedSetAttribute(String attributeName, Object attributeValue)`
`Object`
`getAttribute(String anAttributeName)`
`Enumeration`
`getAttributeNames()`
`String`
`getAuthType()`
`String`
`getCharacterEncoding()`
`int`
`getContentLength()`
`String`
`getContentType()`
`String`
`getContextPath()`
`Cookie[]`
`getCookies()`
`long`
`getDateHeader(String arg1)`
`String`
`getHeader(String key)`
`Enumeration`
`getHeaderNames()`
`Enumeration`
`getHeaders(String arg1)`
`ServletInputStream`
`getInputStream()`
`int`
`getIntHeader(String arg1)`
`Locale`
`getLocale()`
`Enumeration`
`getLocales()`
`String`
`getMethod()`
`String`
`getParameter(String paramName)`
`Map`
`getParameterMap()`
`Enumeration`
`getParameterNames()`
`String[]`
`getParameterValues(String key)`
`String`
`getPathInfo()`
`String`
`getPathTranslated()`
`String`
`getProtocol()`
`String`
`getQueryString()`
`BufferedReader`
`getReader()`
`String`
`getRealPath(String arg1)`
`String`
`getRemoteAddr()`
`String`
`getRemoteHost()`
`String`
`getRemoteUser()`
`RequestDispatcher`
`getRequestDispatcher(String uri)`
`String`
`getRequestedSessionId()`
`String`
`getRequestURI()`
`StringBuffer`
`getRequestURL()`
`String`
`getScheme()`
`String`
`getServerName()`
`int`
`getServerPort()`
`String`
`getServletPath()`
`HttpSession`
`getSession()`
`HttpSession`
`getSession(boolean createSession)`
`Principal`
`getUserPrincipal()`
`boolean`
`isRequestedSessionIdFromCookie()`
`boolean`
`isRequestedSessionIdFromUrl()`
`boolean`
`isRequestedSessionIdFromURL()`
`boolean`
`isRequestedSessionIdValid()`
`boolean`
`isSecure()`
`boolean`
`isUserInRole(String arg1)`
`void`
`removeAttribute(String anAttributeToRemove)`
`void`
`setAttribute(String attributeName, Object attributeValue)`
`void`
`setCharacterEncoding(String s)`
`void`
`setContentType(String contentType)`
`void`
`setExpectedContentType(String aContentType)`
`void`
`setExpectedCreateSession(boolean createSession)`
`void`
`setExpectedRequestDispatcherURI(String uri)`
`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`
`setupGetParameterNames(Enumeration names)`
`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`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockHttpServletRequest

public MockHttpServletRequest()

## Method Details

### setupGetAttribute

public void setupGetAttribute(Object anAttributeToReturn)

### addExpectedGetAttributeName

public void addExpectedGetAttributeName(String anAttributeName)

### getAttribute

public Object getAttribute(String anAttributeName)

### setupGetAttrubuteNames

public void setupGetAttrubuteNames(Enumeration attributeNames)

### getAttributeNames

public Enumeration getAttributeNames()

### getAuthType

public String getAuthType()

### getCharacterEncoding

public String getCharacterEncoding()

### getContentLength

public int getContentLength()

### getContentType

public String getContentType()

### setupGetContentType

public void setupGetContentType(String aContentType)

### setExpectedContentType

public void setExpectedContentType(String aContentType)

### setContentType

public void setContentType(String contentType)

### getContextPath

public String getContextPath()

### setupGetContextPath

public void setupGetContextPath(String contextPath)

### getCookies

public Cookie[] getCookies()

### getDateHeader

public long getDateHeader(String arg1)

### getHeader

public String getHeader(String key)

### getHeaderNames

public Enumeration getHeaderNames()

### getHeaders

public Enumeration getHeaders(String arg1)

### setupGetInputStream

public void setupGetInputStream(ServletInputStream inputStream)

### getInputStream

public ServletInputStream getInputStream() throws IOException

Throws:
  `IOException`

### getIntHeader

public int getIntHeader(String arg1)

### getLocale

public Locale getLocale()

### getLocales

public Enumeration getLocales()

### setupGetMethod

public void setupGetMethod(String aMethod)

### getMethod

public String getMethod()

### getParameter

public String getParameter(String paramName)

### setupGetParameterNames

public void setupGetParameterNames(Enumeration names)

### getParameterNames

public Enumeration getParameterNames()

### getParameterValues

public String[] getParameterValues(String key)

### getPathInfo

public String getPathInfo()

### getPathTranslated

public String getPathTranslated()

### getProtocol

public String getProtocol()

### setupGetProtocol

public void setupGetProtocol(String protocol)

### getQueryString

public String getQueryString()

### getReader

public BufferedReader getReader()

### setupGetReader

public void setupGetReader(BufferedReader reader) throws IOException

Throws:
  `IOException`

### getRealPath

public String getRealPath(String arg1)

### setupGetRemoteAddr

public void setupGetRemoteAddr(String remoteAddress)

### getRemoteAddr

public String getRemoteAddr()

### getRemoteHost

public String getRemoteHost()

### getRemoteUser

public String getRemoteUser()

### setupGetRequestDispatcher

public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher)

### getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String uri)

### setExpectedRequestDispatcherURI

public void setExpectedRequestDispatcherURI(String uri)

### getRequestedSessionId

public String getRequestedSessionId()

### setupGetRequestURI

public void setupGetRequestURI(String aRequestURI)

### getRequestURI

public String getRequestURI()

### getScheme

public String getScheme()

### getServerName

public String getServerName()

### getServerPort

public int getServerPort()

### setupGetServletPath

public void setupGetServletPath(String path)

### getServletPath

public String getServletPath()

### getSession

public HttpSession getSession()

### setSession

public void setSession(HttpSession httpSession)

### setExpectedCreateSession

public void setExpectedCreateSession(boolean createSession)

### getSession

public HttpSession getSession(boolean createSession)

### setupGetUserPrincipal

public void setupGetUserPrincipal(Principal userPrincipal)

### getUserPrincipal

public Principal getUserPrincipal()

### isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()

### isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()

### isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()

### isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()

### isSecure

public boolean isSecure()

### isUserInRole

public boolean isUserInRole(String arg1)

### setupRemoveAttribute

public void setupRemoveAttribute(String anAttributeToRemove)

### removeAttribute

public void removeAttribute(String anAttributeToRemove)

### addExpectedSetAttribute

public void addExpectedSetAttribute(String attributeName, Object attributeValue)

### setAttribute

public void setAttribute(String attributeName, Object attributeValue)

### setupAddParameter

public void setupAddParameter(String paramName, String[] values)

### setupAddParameter

public void setupAddParameter(String paramName, String value)

### setupAddHeader

public void setupAddHeader(String headerName, String value)

### setupPathInfo

public void setupPathInfo(String pathInfo)

### setupQueryString

public void setupQueryString(String aQueryString)

### setupScheme

public void setupScheme(String aScheme)

### setupServerName

public void setupServerName(String aServerName)

### getRequestURL

public StringBuffer getRequestURL()

### setCharacterEncoding

public void setCharacterEncoding(String s)

### setupGetParameterMap

public void setupGetParameterMap(Map map)

### getParameterMap

public Map getParameterMap()