Class MockPortletResponse
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletResponse
- All Implemented Interfaces:
PortletResponse
- Direct Known Subclasses:
MockMimeResponse,MockStateAwareResponse
public class MockPortletResponse extends Object implements PortletResponse
Mock implementation of thePortletResponseinterface.- Since:
- 2.0
- Author:
- John A. Lewis, Juergen Hoeller
Constructor Summary
Constructors Constructor Description MockPortletResponse()Create a new MockPortletResponse with a defaultMockPortalContext.MockPortletResponse(PortalContext portalContext)Create a new MockPortletResponse.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(String key, String value)voidaddProperty(String key, Element value)voidaddProperty(Cookie cookie)ElementcreateElement(String tagName)StringencodeURL(String path)CookiegetCookie(String name)Cookie[]getCookies()StringgetNamespace()PortalContextgetPortalContext()Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.String[]getProperties(String key)StringgetProperty(String key)Set<String>getPropertyNames()Element[]getXmlProperties(String key)ElementgetXmlProperty(String key)Set<String>getXmlPropertyNames()voidsetNamespace(String namespace)voidsetProperty(String key, String value)
Constructor Detail
MockPortletResponse
public MockPortletResponse()
Create a new MockPortletResponse with a defaultMockPortalContext.- See Also:
MockPortalContext
MockPortletResponse
public MockPortletResponse(PortalContext portalContext)
Create a new MockPortletResponse.- Parameters:
portalContext- the PortalContext defining the supported PortletModes and WindowStates
Method Detail
getPortalContext
public PortalContext getPortalContext()
Return the PortalContext that this MockPortletResponse runs in, defining the supported PortletModes and WindowStates.
addProperty
public void addProperty(String key, String value)
- Specified by:
addPropertyin interfacePortletResponse
setProperty
public void setProperty(String key, String value)
- Specified by:
setPropertyin interfacePortletResponse
getPropertyNames
public Set<String> getPropertyNames()
getProperty
public String getProperty(String key)
getProperties
public String[] getProperties(String key)
encodeURL
public String encodeURL(String path)
- Specified by:
encodeURLin interfacePortletResponse
setNamespace
public void setNamespace(String namespace)
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfacePortletResponse
addProperty
public void addProperty(Cookie cookie)
- Specified by:
addPropertyin interfacePortletResponse
getCookies
public Cookie[] getCookies()
addProperty
public void addProperty(String key, Element value)
- Specified by:
addPropertyin interfacePortletResponse
getXmlPropertyNames
public Set<String> getXmlPropertyNames()
getXmlProperty
public Element getXmlProperty(String key)
getXmlProperties
public Element[] getXmlProperties(String key)
createElement
public Element createElement(String tagName) throws DOMException
- Specified by:
createElementin interfacePortletResponse- Throws:
DOMException