public class

MockPortletContext

extends Object
java.lang.Object
   ↳ org.springframework.mock.web.portlet.MockPortletContext

Class Overview

Mock implementation of the javax.portlet.PortletContext interface.

Summary

Public Constructors
MockPortletContext()
Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e.
MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.
MockPortletContext(ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader and no base path.
MockPortletContext(String resourceBasePath, ResourceLoader resourceLoader)
Create a new MockPortletContext.
Public Methods
void addContainerRuntimeOption(String key)
void addInitParameter(String name, String value)
Object getAttribute(String name)
Enumeration<String> getAttributeNames()
Enumeration<String> getContainerRuntimeOptions()
String getInitParameter(String name)
Enumeration<String> getInitParameterNames()
int getMajorVersion()
String getMimeType(String filePath)
int getMinorVersion()
PortletRequestDispatcher getNamedDispatcher(String path)
String getPortletContextName()
String getRealPath(String path)
PortletRequestDispatcher getRequestDispatcher(String path)
URL getResource(String path)
InputStream getResourceAsStream(String path)
Set<String> getResourcePaths(String path)
String getServerInfo()
void log(String message, Throwable t)
void log(String message)
void removeAttribute(String name)
void setAttribute(String name, Object value)
void setPortletContextName(String portletContextName)
Protected Methods
String getResourceLocation(String path)
Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MockPortletContext ()

Create a new MockPortletContext with no base path and a DefaultResourceLoader (i.e. the classpath root as WAR root).

public MockPortletContext (String resourceBasePath)

Create a new MockPortletContext using a DefaultResourceLoader.

Parameters
resourceBasePath the WAR root directory (should not end with a slash)

public MockPortletContext (ResourceLoader resourceLoader)

Create a new MockPortletContext, using the specified ResourceLoader and no base path.

Parameters
resourceLoader the ResourceLoader to use (or null for the default)

public MockPortletContext (String resourceBasePath, ResourceLoader resourceLoader)

Create a new MockPortletContext.

Parameters
resourceBasePath the WAR root directory (should not end with a slash)
resourceLoader the ResourceLoader to use (or null for the default)

Public Methods

public void addContainerRuntimeOption (String key)

public void addInitParameter (String name, String value)

public Object getAttribute (String name)

public Enumeration<String> getAttributeNames ()

public Enumeration<String> getContainerRuntimeOptions ()

public String getInitParameter (String name)

public Enumeration<String> getInitParameterNames ()

public int getMajorVersion ()

public String getMimeType (String filePath)

public int getMinorVersion ()

public PortletRequestDispatcher getNamedDispatcher (String path)

public String getPortletContextName ()

public String getRealPath (String path)

public PortletRequestDispatcher getRequestDispatcher (String path)

public URL getResource (String path)

public InputStream getResourceAsStream (String path)

public Set<String> getResourcePaths (String path)

public String getServerInfo ()

public void log (String message, Throwable t)

public void log (String message)

public void removeAttribute (String name)

public void setAttribute (String name, Object value)

public void setPortletContextName (String portletContextName)

Protected Methods

protected String getResourceLocation (String path)

Build a full resource location for the given path, prepending the resource base path of this MockPortletContext.

Parameters
path the path as specified
Returns
  • the full resource path