Class MockPortletRequest
Object
com.liferay.portal.kernel.test.portlet.MockPortletRequest
- All Implemented Interfaces:
PortletRequest
,RenderState
- Direct Known Subclasses:
MockClientDataRequest
,MockRenderRequest
- Author:
- Dante Wang
-
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, HEADER_PHASE, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
-
Constructor Summary
ConstructorsConstructorDescriptionMockPortletRequest
(PortalContext portalContext, PortletContext portletContext) MockPortletRequest
(PortletContext portletContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addParameter
(String name, String value) void
addParameter
(String name, String[] values) void
addPreferredLocale
(Locale locale) void
addPreferredResponseContentType
(String responseContentType) void
addProperty
(String key, String value) void
addResponseContentType
(String responseContentType) void
addUserRole
(String role) protected void
void
close()
getAttribute
(String name) javax.servlet.http.Cookie[]
protected String
getParameter
(String name) String[]
getParameterValues
(String name) getPortletSession
(boolean create) getProperties
(String key) getProperty
(String key) int
boolean
isActive()
boolean
isPortletModeAllowed
(PortletMode portletMode) boolean
boolean
isSecure()
boolean
isUserInRole
(String role) boolean
isWindowStateAllowed
(WindowState windowState) void
void
removeAttribute
(String name) void
setAttribute
(String name, Object value) void
setAuthType
(String authType) void
setContextPath
(String contextPath) void
setCookies
(javax.servlet.http.Cookie... cookies) void
setParameter
(String key, String value) void
setParameter
(String key, String[] values) void
setParameters
(Map<String, String[]> parameters) void
setPortletMode
(PortletMode portletMode) void
setPortletSession
(PortletSession portletSession) void
setPreferences
(PortletPreferences portletPreferences) void
setProperty
(String key, String value) void
setRemoteUser
(String remoteUser) void
setRequestedSessionIdValid
(boolean requestedSessionIdValid) void
void
setSecure
(boolean secure) void
setServerName
(String serverName) void
setServerPort
(int serverPort) void
setUserPrincipal
(Principal userPrincipal) void
setWindowID
(String windowID) void
setWindowState
(WindowState windowState)
-
Constructor Details
-
MockPortletRequest
public MockPortletRequest() -
MockPortletRequest
-
MockPortletRequest
-
-
Method Details
-
addLocale
-
addParameter
-
addParameter
-
addPreferredLocale
-
addPreferredResponseContentType
-
addProperty
-
addResponseContentType
-
addUserRole
-
close
public void close() -
getAttribute
- Specified by:
getAttribute
in interfacePortletRequest
-
getAttributeNames
- Specified by:
getAttributeNames
in interfacePortletRequest
-
getAuthType
- Specified by:
getAuthType
in interfacePortletRequest
-
getContextPath
- Specified by:
getContextPath
in interfacePortletRequest
-
getCookies
public javax.servlet.http.Cookie[] getCookies()- Specified by:
getCookies
in interfacePortletRequest
-
getLocale
- Specified by:
getLocale
in interfacePortletRequest
-
getLocales
- Specified by:
getLocales
in interfacePortletRequest
-
getParameter
- Specified by:
getParameter
in interfacePortletRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfacePortletRequest
-
getParameterNames
- Specified by:
getParameterNames
in interfacePortletRequest
-
getParameterValues
- Specified by:
getParameterValues
in interfacePortletRequest
-
getPortalContext
- Specified by:
getPortalContext
in interfacePortletRequest
-
getPortletContext
- Specified by:
getPortletContext
in interfacePortletRequest
-
getPortletMode
- Specified by:
getPortletMode
in interfaceRenderState
-
getPortletSession
- Specified by:
getPortletSession
in interfacePortletRequest
-
getPortletSession
- Specified by:
getPortletSession
in interfacePortletRequest
-
getPreferences
- Specified by:
getPreferences
in interfacePortletRequest
-
getPrivateParameterMap
- Specified by:
getPrivateParameterMap
in interfacePortletRequest
-
getProperties
- Specified by:
getProperties
in interfacePortletRequest
-
getProperty
- Specified by:
getProperty
in interfacePortletRequest
-
getPropertyNames
- Specified by:
getPropertyNames
in interfacePortletRequest
-
getPublicParameterMap
- Specified by:
getPublicParameterMap
in interfacePortletRequest
-
getRemoteUser
- Specified by:
getRemoteUser
in interfacePortletRequest
-
getRenderParameters
- Specified by:
getRenderParameters
in interfaceRenderState
-
getRequestedSessionId
- Specified by:
getRequestedSessionId
in interfacePortletRequest
-
getResponseContentType
- Specified by:
getResponseContentType
in interfacePortletRequest
-
getResponseContentTypes
- Specified by:
getResponseContentTypes
in interfacePortletRequest
-
getScheme
- Specified by:
getScheme
in interfacePortletRequest
-
getServerName
- Specified by:
getServerName
in interfacePortletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPort
in interfacePortletRequest
-
getUserAgent
- Specified by:
getUserAgent
in interfacePortletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfacePortletRequest
-
getWindowID
- Specified by:
getWindowID
in interfacePortletRequest
-
getWindowState
- Specified by:
getWindowState
in interfaceRenderState
-
isActive
public boolean isActive() -
isPortletModeAllowed
- Specified by:
isPortletModeAllowed
in interfacePortletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValid
in interfacePortletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfacePortletRequest
-
isUserInRole
- Specified by:
isUserInRole
in interfacePortletRequest
-
isWindowStateAllowed
- Specified by:
isWindowStateAllowed
in interfacePortletRequest
-
registerPublicParameter
-
removeAttribute
- Specified by:
removeAttribute
in interfacePortletRequest
-
setAttribute
- Specified by:
setAttribute
in interfacePortletRequest
-
setAuthType
-
setContextPath
-
setCookies
public void setCookies(javax.servlet.http.Cookie... cookies) -
setParameter
-
setParameter
-
setParameters
-
setPortletMode
-
setPortletSession
-
setPreferences
-
setProperty
-
setRemoteUser
-
setRequestedSessionIdValid
public void setRequestedSessionIdValid(boolean requestedSessionIdValid) -
setScheme
-
setSecure
public void setSecure(boolean secure) -
setServerName
-
setServerPort
public void setServerPort(int serverPort) -
setUserPrincipal
-
setWindowID
-
setWindowState
-
checkActive
- Throws:
IllegalStateException
-
getLifecyclePhase
-