public class

MockPortletRequest

extends Object
java.lang.Object
   ↳ org.springframework.mock.web.portlet.MockPortletRequest
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Mock implementation of the javax.portlet.PortletRequest interface.

Summary

Public Constructors
MockPortletRequest()
Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.
MockPortletRequest(PortletContext portletContext)
Create a new MockPortletRequest with a default MockPortalContext.
MockPortletRequest(PortalContext portalContext, PortletContext portletContext)
Create a new MockPortletRequest.
Public Methods
void addLocale(Locale locale)
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)
Add a single value for the specified property.
void addResponseContentType(String responseContentType)
void addUserRole(String role)
void close()
Mark this request as completed.
Object getAttribute(String name)
Enumeration<String> getAttributeNames()
String getAuthType()
String getContextPath()
Cookie[] getCookies()
Locale getLocale()
Enumeration<Locale> getLocales()
String getParameter(String name)
Map<StringString[]> getParameterMap()
Enumeration<String> getParameterNames()
String[] getParameterValues(String name)
PortalContext getPortalContext()
PortletMode getPortletMode()
PortletSession getPortletSession(boolean create)
PortletSession getPortletSession()
PortletPreferences getPreferences()
Map<StringString[]> getPrivateParameterMap()
Enumeration<String> getProperties(String key)
String getProperty(String key)
Enumeration<String> getPropertyNames()
Map<StringString[]> getPublicParameterMap()
String getRemoteUser()
String getRequestedSessionId()
String getResponseContentType()
Enumeration<String> getResponseContentTypes()
String getScheme()
String getServerName()
int getServerPort()
Principal getUserPrincipal()
String getWindowID()
WindowState getWindowState()
boolean isActive()
Return whether this request is still active (that is, not completed yet).
boolean isPortletModeAllowed(PortletMode portletMode)
boolean isRequestedSessionIdValid()
boolean isSecure()
boolean isUserInRole(String role)
boolean isWindowStateAllowed(WindowState windowState)
void registerPublicParameter(String name)
void removeAttribute(String name)
void setAttribute(String name, Object value)
void setAuthType(String authType)
void setContextPath(String contextPath)
void setCookies(Cookie... cookies)
void setParameter(String key, String[] values)
void setParameter(String key, String value)
void setParameters(Map<StringString[]> parameters)
void setPortletMode(PortletMode portletMode)
void setPreferences(PortletPreferences preferences)
void setProperty(String key, String value)
Set a single value for the specified property.
void setRemoteUser(String remoteUser)
void setRequestedSessionIdValid(boolean requestedSessionIdValid)
void setScheme(String scheme)
void setSecure(boolean secure)
void setServerName(String serverName)
void setServerPort(int serverPort)
void setSession(PortletSession session)
void setUserPrincipal(Principal userPrincipal)
void setWindowID(String windowID)
void setWindowState(WindowState windowState)
Protected Methods
void checkActive()
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
String getLifecyclePhase()
Return the Portlet 2.0 lifecycle id for the current phase.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MockPortletRequest ()

Create a new MockPortletRequest with a default MockPortalContext and a default MockPortletContext.

public MockPortletRequest (PortletContext portletContext)

Create a new MockPortletRequest with a default MockPortalContext.

Parameters
portletContext the PortletContext that the request runs in

public MockPortletRequest (PortalContext portalContext, PortletContext portletContext)

Create a new MockPortletRequest.

Parameters
portalContext the PortalContext that the request runs in
portletContext the PortletContext that the request runs in

Public Methods

public void addLocale (Locale locale)

public void addParameter (String name, String value)

public void addParameter (String name, String[] values)

public void addPreferredLocale (Locale locale)

public void addPreferredResponseContentType (String responseContentType)

public void addProperty (String key, String value)

Add a single value for the specified property.

If there are already one or more values registered for the given property key, the given value will be added to the end of the list.

public void addResponseContentType (String responseContentType)

public void addUserRole (String role)

public void close ()

Mark this request as completed.

public Object getAttribute (String name)

public Enumeration<String> getAttributeNames ()

public String getAuthType ()

public String getContextPath ()

public Cookie[] getCookies ()

public Locale getLocale ()

public Enumeration<Locale> getLocales ()

public String getParameter (String name)

public Map<StringString[]> getParameterMap ()

public Enumeration<String> getParameterNames ()

public String[] getParameterValues (String name)

public PortalContext getPortalContext ()

public PortletMode getPortletMode ()

public PortletSession getPortletSession (boolean create)

public PortletSession getPortletSession ()

public PortletPreferences getPreferences ()

public Map<StringString[]> getPrivateParameterMap ()

public Enumeration<String> getProperties (String key)

public String getProperty (String key)

public Enumeration<String> getPropertyNames ()

public Map<StringString[]> getPublicParameterMap ()

public String getRemoteUser ()

public String getRequestedSessionId ()

public String getResponseContentType ()

public Enumeration<String> getResponseContentTypes ()

public String getScheme ()

public String getServerName ()

public int getServerPort ()

public Principal getUserPrincipal ()

public String getWindowID ()

public WindowState getWindowState ()

public boolean isActive ()

Return whether this request is still active (that is, not completed yet).

public boolean isPortletModeAllowed (PortletMode portletMode)

public boolean isRequestedSessionIdValid ()

public boolean isSecure ()

public boolean isUserInRole (String role)

public boolean isWindowStateAllowed (WindowState windowState)

public void registerPublicParameter (String name)

public void removeAttribute (String name)

public void setAttribute (String name, Object value)

public void setAuthType (String authType)

public void setContextPath (String contextPath)

public void setCookies (Cookie... cookies)

public void setParameter (String key, String[] values)

public void setParameter (String key, String value)

public void setParameters (Map<StringString[]> parameters)

public void setPortletMode (PortletMode portletMode)

public void setPreferences (PortletPreferences preferences)

public void setProperty (String key, String value)

Set a single value for the specified property.

If there are already one or more values registered for the given property key, they will be replaced.

public void setRemoteUser (String remoteUser)

public void setRequestedSessionIdValid (boolean requestedSessionIdValid)

public void setScheme (String scheme)

public void setSecure (boolean secure)

public void setServerName (String serverName)

public void setServerPort (int serverPort)

public void setSession (PortletSession session)

public void setUserPrincipal (Principal userPrincipal)

public void setWindowID (String windowID)

public void setWindowState (WindowState windowState)

Protected Methods

protected void checkActive ()

Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.

protected String getLifecyclePhase ()

Return the Portlet 2.0 lifecycle id for the current phase.