Class MockClientDataRequest
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletRequest
- org.springframework.mock.web.portlet.MockClientDataRequest
- All Implemented Interfaces:
ClientDataRequest
,PortletRequest
- Direct Known Subclasses:
MockActionRequest
,MockResourceRequest
public class MockClientDataRequest extends MockPortletRequest implements ClientDataRequest
Mock implementation of theClientDataRequest
interface.- Since:
- 3.0
- Author:
- Juergen Hoeller
Nested Class Summary
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
PortletRequest.P3PUserInfos
Field Summary
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
Constructor Summary
Constructors Constructor Description MockClientDataRequest()
Create a new MockClientDataRequest with a defaultMockPortalContext
and a defaultMockPortletContext
.MockClientDataRequest(PortalContext portalContext, PortletContext portletContext)
Create a new MockClientDataRequest.MockClientDataRequest(PortletContext portletContext)
Create a new MockClientDataRequest with a defaultMockPortalContext
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCharacterEncoding()
int
getContentLength()
String
getContentType()
String
getMethod()
InputStream
getPortletInputStream()
BufferedReader
getReader()
void
setCharacterEncoding(String characterEncoding)
void
setContent(byte[] content)
void
setContentType(String contentType)
void
setMethod(String method)
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLifecyclePhase, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
Constructor Detail
MockClientDataRequest
public MockClientDataRequest()
Create a new MockClientDataRequest with a defaultMockPortalContext
and a defaultMockPortletContext
.- See Also:
MockPortalContext
,MockPortletContext
MockClientDataRequest
public MockClientDataRequest(PortletContext portletContext)
Create a new MockClientDataRequest with a defaultMockPortalContext
.- Parameters:
portletContext
- the PortletContext that the request runs in
MockClientDataRequest
public MockClientDataRequest(PortalContext portalContext, PortletContext portletContext)
Create a new MockClientDataRequest.- Parameters:
portalContext
- the PortalContext that the request runs inportletContext
- the PortletContext that the request runs in
Method Detail
setContent
public void setContent(byte[] content)
getPortletInputStream
public InputStream getPortletInputStream() throws IOException
- Specified by:
getPortletInputStream
in interfaceClientDataRequest
- Throws:
IOException
setCharacterEncoding
public void setCharacterEncoding(String characterEncoding)
- Specified by:
setCharacterEncoding
in interfaceClientDataRequest
getReader
public BufferedReader getReader() throws UnsupportedEncodingException
- Specified by:
getReader
in interfaceClientDataRequest
- Throws:
UnsupportedEncodingException
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfaceClientDataRequest
setContentType
public void setContentType(String contentType)
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceClientDataRequest
getContentLength
public int getContentLength()
- Specified by:
getContentLength
in interfaceClientDataRequest
getMethod
public String getMethod()
- Specified by:
getMethod
in interfaceClientDataRequest