org.apache.tapestry.test.mock
Class MockRequest
java.lang.Object
org.apache.tapestry.test.mock.AttributeHolder
org.apache.tapestry.test.mock.MockRequest
- All Implemented Interfaces:
- HttpServletRequest, ServletRequest
public class MockRequest
- extends AttributeHolder
- implements HttpServletRequest
Mock implementation of HttpServletRequest
.
- Since:
- 4.0
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockRequest
public MockRequest(MockContext servletContext,
String servletPath)
getAuthType
public String getAuthType()
- Specified by:
getAuthType
in interface HttpServletRequest
getCookies
public Cookie[] getCookies()
- Specified by:
getCookies
in interface HttpServletRequest
getDateHeader
public long getDateHeader(String arg0)
- Specified by:
getDateHeader
in interface HttpServletRequest
getHeader
public String getHeader(String key)
- Specified by:
getHeader
in interface HttpServletRequest
getHeaders
public Enumeration getHeaders(String name)
- Specified by:
getHeaders
in interface HttpServletRequest
getHeaderNames
public Enumeration getHeaderNames()
- Specified by:
getHeaderNames
in interface HttpServletRequest
getIntHeader
public int getIntHeader(String arg0)
- Specified by:
getIntHeader
in interface HttpServletRequest
getMethod
public String getMethod()
- Specified by:
getMethod
in interface HttpServletRequest
getPathInfo
public String getPathInfo()
- Specified by:
getPathInfo
in interface HttpServletRequest
getPathTranslated
public String getPathTranslated()
- Specified by:
getPathTranslated
in interface HttpServletRequest
getContextPath
public String getContextPath()
- Specified by:
getContextPath
in interface HttpServletRequest
getQueryString
public String getQueryString()
- Specified by:
getQueryString
in interface HttpServletRequest
getRemoteUser
public String getRemoteUser()
- Specified by:
getRemoteUser
in interface HttpServletRequest
isUserInRole
public boolean isUserInRole(String arg0)
- Specified by:
isUserInRole
in interface HttpServletRequest
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interface HttpServletRequest
getRequestedSessionId
public String getRequestedSessionId()
- Specified by:
getRequestedSessionId
in interface HttpServletRequest
getRequestURI
public String getRequestURI()
- Specified by:
getRequestURI
in interface HttpServletRequest
getRequestURL
public StringBuffer getRequestURL()
- Specified by:
getRequestURL
in interface HttpServletRequest
getServletPath
public String getServletPath()
- Specified by:
getServletPath
in interface HttpServletRequest
getSession
public HttpSession getSession(boolean create)
- Specified by:
getSession
in interface HttpServletRequest
getSession
public HttpSession getSession()
- Specified by:
getSession
in interface HttpServletRequest
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
- Specified by:
isRequestedSessionIdValid
in interface HttpServletRequest
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
- Specified by:
isRequestedSessionIdFromCookie
in interface HttpServletRequest
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
- Specified by:
isRequestedSessionIdFromURL
in interface HttpServletRequest
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()
- Specified by:
isRequestedSessionIdFromUrl
in interface HttpServletRequest
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interface ServletRequest
setCharacterEncoding
public void setCharacterEncoding(String arg0)
throws UnsupportedEncodingException
- Specified by:
setCharacterEncoding
in interface ServletRequest
- Throws:
UnsupportedEncodingException
getContentLength
public int getContentLength()
- Specified by:
getContentLength
in interface ServletRequest
getContentType
public String getContentType()
- Specified by:
getContentType
in interface ServletRequest
setContentType
public void setContentType(String contentType)
getInputStream
public ServletInputStream getInputStream()
throws IOException
- Specified by:
getInputStream
in interface ServletRequest
- Throws:
IOException
getParameter
public String getParameter(String name)
- Specified by:
getParameter
in interface ServletRequest
getParameterNames
public Enumeration getParameterNames()
- Specified by:
getParameterNames
in interface ServletRequest
getParameterValues
public String[] getParameterValues(String name)
- Specified by:
getParameterValues
in interface ServletRequest
getParameterMap
public Map getParameterMap()
- Not part of 2.1 API, not used by Tapestry.
- Specified by:
getParameterMap
in interface ServletRequest
getProtocol
public String getProtocol()
- Specified by:
getProtocol
in interface ServletRequest
getScheme
public String getScheme()
- Specified by:
getScheme
in interface ServletRequest
getServerName
public String getServerName()
- Specified by:
getServerName
in interface ServletRequest
getServerPort
public int getServerPort()
- Specified by:
getServerPort
in interface ServletRequest
getReader
public BufferedReader getReader()
throws IOException
- Specified by:
getReader
in interface ServletRequest
- Throws:
IOException
getRemoteAddr
public String getRemoteAddr()
- Specified by:
getRemoteAddr
in interface ServletRequest
getRemoteHost
public String getRemoteHost()
- Specified by:
getRemoteHost
in interface ServletRequest
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interface ServletRequest
setLocale
public void setLocale(Locale locale)
getLocales
public Enumeration getLocales()
- Specified by:
getLocales
in interface ServletRequest
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interface ServletRequest
getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String path)
- Specified by:
getRequestDispatcher
in interface ServletRequest
getRealPath
public String getRealPath(String arg0)
- Specified by:
getRealPath
in interface ServletRequest
setContextPath
public void setContextPath(String contextPath)
setMethod
public void setMethod(String method)
setParameter
public void setParameter(String name,
String[] values)
setParameter
public void setParameter(String name,
String value)
addCookie
public void addCookie(Cookie cookie)
addCookies
public void addCookies(Cookie[] cookies)
simulateFailover
public void simulateFailover()
- Delegates this to the
MockSession
, if
it exists.
- Overrides:
simulateFailover
in class AttributeHolder
getContentPath
public String getContentPath()
setContentPath
public void setContentPath(String contentPath)
getRemotePort
public int getRemotePort()
- Specified by:
getRemotePort
in interface ServletRequest
getLocalName
public String getLocalName()
- Specified by:
getLocalName
in interface ServletRequest
getLocalAddr
public String getLocalAddr()
- Specified by:
getLocalAddr
in interface ServletRequest
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in interface ServletRequest
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.