Spring Framework

org.springframework.mock.web.portlet
Class MockPortletResponse

java.lang.Object
  extended by org.springframework.mock.web.portlet.MockPortletResponse
All Implemented Interfaces:
javax.portlet.PortletResponse
Direct Known Subclasses:
MockMimeResponse, MockStateAwareResponse

public class MockPortletResponse
extends java.lang.Object
implements javax.portlet.PortletResponse

Mock implementation of the PortletResponse interface.

Since:
2.0
Author:
John A. Lewis, Juergen Hoeller

Constructor Summary
MockPortletResponse()
          Create a new MockPortletResponse with a default MockPortalContext.
MockPortletResponse(javax.portlet.PortalContext portalContext)
          Create a new MockPortletResponse.
 
Method Summary
 void addProperty(javax.servlet.http.Cookie cookie)
           
 void addProperty(java.lang.String key, org.w3c.dom.Element value)
           
 void addProperty(java.lang.String key, java.lang.String value)
           
 org.w3c.dom.Element createElement(java.lang.String tagName)
           
 java.lang.String encodeURL(java.lang.String path)
           
 javax.servlet.http.Cookie getCookie(java.lang.String name)
           
 javax.servlet.http.Cookie[] getCookies()
           
 java.lang.String getNamespace()
           
 javax.portlet.PortalContext getPortalContext()
          Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.
 java.lang.String[] getProperties(java.lang.String key)
           
 java.lang.String getProperty(java.lang.String key)
           
 java.util.Set<java.lang.String> getPropertyNames()
           
 org.w3c.dom.Element[] getXmlProperties(java.lang.String key)
           
 org.w3c.dom.Element getXmlProperty(java.lang.String key)
           
 java.util.Set<java.lang.String> getXmlPropertyNames()
           
 void setNamespace(java.lang.String namespace)
           
 void setProperty(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockPortletResponse

public MockPortletResponse()
Create a new MockPortletResponse with a default MockPortalContext.

See Also:
MockPortalContext

MockPortletResponse

public MockPortletResponse(javax.portlet.PortalContext portalContext)
Create a new MockPortletResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
Method Detail

getPortalContext

public javax.portlet.PortalContext getPortalContext()
Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.


addProperty

public void addProperty(java.lang.String key,
                        java.lang.String value)
Specified by:
addProperty in interface javax.portlet.PortletResponse

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Specified by:
setProperty in interface javax.portlet.PortletResponse

getPropertyNames

public java.util.Set<java.lang.String> getPropertyNames()

getProperty

public java.lang.String getProperty(java.lang.String key)

getProperties

public java.lang.String[] getProperties(java.lang.String key)

encodeURL

public java.lang.String encodeURL(java.lang.String path)
Specified by:
encodeURL in interface javax.portlet.PortletResponse

setNamespace

public void setNamespace(java.lang.String namespace)

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface javax.portlet.PortletResponse

addProperty

public void addProperty(javax.servlet.http.Cookie cookie)
Specified by:
addProperty in interface javax.portlet.PortletResponse

getCookies

public javax.servlet.http.Cookie[] getCookies()

getCookie

public javax.servlet.http.Cookie getCookie(java.lang.String name)

addProperty

public void addProperty(java.lang.String key,
                        org.w3c.dom.Element value)
Specified by:
addProperty in interface javax.portlet.PortletResponse

getXmlPropertyNames

public java.util.Set<java.lang.String> getXmlPropertyNames()

getXmlProperty

public org.w3c.dom.Element getXmlProperty(java.lang.String key)

getXmlProperties

public org.w3c.dom.Element[] getXmlProperties(java.lang.String key)

createElement

public org.w3c.dom.Element createElement(java.lang.String tagName)
                                  throws org.w3c.dom.DOMException
Specified by:
createElement in interface javax.portlet.PortletResponse
Throws:
org.w3c.dom.DOMException

Spring Framework