|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.test.mock.MockPortletContext
public class MockPortletContext
Mock implementation of PortletContext
.
Constructor Summary | |
---|---|
MockPortletContext()
|
Method Summary | |
---|---|
void |
addInitParameter(String name,
String value)
Add a context initialization parameter to the set of parameters recognized by this instance. |
void |
addMimeType(String extension,
String contentType)
Add a new MIME type mapping to the set of mappings recognized by this instance. |
Object |
getAttribute(String name)
|
Enumeration |
getAttributeNames()
|
String |
getInitParameter(String name)
|
Enumeration |
getInitParameterNames()
|
int |
getMajorVersion()
|
String |
getMimeType(String path)
|
int |
getMinorVersion()
|
javax.portlet.PortletRequestDispatcher |
getNamedDispatcher(String arg0)
|
String |
getPortletContextName()
|
String |
getRealPath(String path)
|
javax.portlet.PortletRequestDispatcher |
getRequestDispatcher(String arg0)
|
URL |
getResource(String path)
|
InputStream |
getResourceAsStream(String path)
|
Set |
getResourcePaths(String path)
|
String |
getServerInfo()
|
void |
log(String message)
|
void |
log(String message,
Throwable exception)
|
void |
removeAttribute(String name)
|
void |
setAttribute(String name,
Object value)
|
void |
setDocumentRoot(File documentRoot)
Set the document root for getRealPath() resolution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockPortletContext()
Method Detail |
---|
public void addInitParameter(String name, String value)
Add a context initialization parameter to the set of parameters recognized by this instance.
name
- Parameter namevalue
- Parameter valuepublic void addMimeType(String extension, String contentType)
Add a new MIME type mapping to the set of mappings recognized by this instance.
extension
- Extension to check for (without the period)contentType
- Corresponding content typepublic void setDocumentRoot(File documentRoot)
Set the document root for getRealPath()
resolution.
This parameter MUST represent a directory.
documentRoot
- The new base directorypublic Object getAttribute(String name)
getAttribute
in interface javax.portlet.PortletContext
public Enumeration getAttributeNames()
getAttributeNames
in interface javax.portlet.PortletContext
public String getInitParameter(String name)
getInitParameter
in interface javax.portlet.PortletContext
public Enumeration getInitParameterNames()
getInitParameterNames
in interface javax.portlet.PortletContext
public int getMajorVersion()
getMajorVersion
in interface javax.portlet.PortletContext
public String getMimeType(String path)
getMimeType
in interface javax.portlet.PortletContext
public int getMinorVersion()
getMinorVersion
in interface javax.portlet.PortletContext
public javax.portlet.PortletRequestDispatcher getNamedDispatcher(String arg0)
getNamedDispatcher
in interface javax.portlet.PortletContext
public String getPortletContextName()
getPortletContextName
in interface javax.portlet.PortletContext
public String getRealPath(String path)
getRealPath
in interface javax.portlet.PortletContext
public javax.portlet.PortletRequestDispatcher getRequestDispatcher(String arg0)
getRequestDispatcher
in interface javax.portlet.PortletContext
public URL getResource(String path) throws MalformedURLException
getResource
in interface javax.portlet.PortletContext
MalformedURLException
public InputStream getResourceAsStream(String path)
getResourceAsStream
in interface javax.portlet.PortletContext
public Set getResourcePaths(String path)
getResourcePaths
in interface javax.portlet.PortletContext
public String getServerInfo()
getServerInfo
in interface javax.portlet.PortletContext
public void log(String message)
log
in interface javax.portlet.PortletContext
public void log(String message, Throwable exception)
log
in interface javax.portlet.PortletContext
public void removeAttribute(String name)
removeAttribute
in interface javax.portlet.PortletContext
public void setAttribute(String name, Object value)
setAttribute
in interface javax.portlet.PortletContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |