Class MockMimeResponse
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletResponse
- org.springframework.mock.web.portlet.MockMimeResponse
- All Implemented Interfaces:
MimeResponse,PortletResponse
- Direct Known Subclasses:
MockRenderResponse,MockResourceResponse
public class MockMimeResponse extends MockPortletResponse implements MimeResponse
Mock implementation of theMimeResponseinterface.- Since:
- 3.0
- Author:
- Juergen Hoeller
Field Summary
Fields inherited from interface javax.portlet.MimeResponse
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT
Constructor Summary
Constructors Constructor Description MockMimeResponse()Create a new MockMimeResponse with a defaultMockPortalContext.MockMimeResponse(PortalContext portalContext)Create a new MockMimeResponse.MockMimeResponse(PortalContext portalContext, PortletRequest request)Create a new MockMimeResponse.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortletURLcreateActionURL()PortletURLcreateRenderURL()ResourceURLcreateResourceURL()voidflushBuffer()intgetBufferSize()CacheControlgetCacheControl()StringgetCharacterEncoding()byte[]getContentAsByteArray()StringgetContentAsString()StringgetContentType()StringgetForwardedUrl()StringgetIncludedUrl()LocalegetLocale()OutputStreamgetPortletOutputStream()PrintWritergetWriter()booleanisCommitted()voidreset()voidresetBuffer()voidsetBufferSize(int bufferSize)voidsetCharacterEncoding(String characterEncoding)voidsetCommitted(boolean committed)voidsetContentType(String contentType)voidsetForwardedUrl(String forwardedUrl)voidsetIncludedUrl(String includedUrl)voidsetLocale(Locale locale)Methods inherited from class org.springframework.mock.web.portlet.MockPortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getCookie, getCookies, getNamespace, getPortalContext, getProperties, getProperty, getPropertyNames, getXmlProperties, getXmlProperty, getXmlPropertyNames, setNamespace, setProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty
Constructor Detail
MockMimeResponse
public MockMimeResponse()
Create a new MockMimeResponse with a defaultMockPortalContext.- See Also:
MockPortalContext
MockMimeResponse
public MockMimeResponse(PortalContext portalContext)
Create a new MockMimeResponse.- Parameters:
portalContext- the PortalContext defining the supported PortletModes and WindowStates
MockMimeResponse
public MockMimeResponse(PortalContext portalContext, PortletRequest request)
Create a new MockMimeResponse.- Parameters:
portalContext- the PortalContext defining the supported PortletModes and WindowStatesrequest- the corresponding render/resource request that this response is being generated for
Method Detail
setContentType
public void setContentType(String contentType)
- Specified by:
setContentTypein interfaceMimeResponse
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceMimeResponse
setCharacterEncoding
public void setCharacterEncoding(String characterEncoding)
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncodingin interfaceMimeResponse
getWriter
public PrintWriter getWriter() throws UnsupportedEncodingException
- Specified by:
getWriterin interfaceMimeResponse- Throws:
UnsupportedEncodingException
getContentAsByteArray
public byte[] getContentAsByteArray()
getContentAsString
public String getContentAsString() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceMimeResponse
setBufferSize
public void setBufferSize(int bufferSize)
- Specified by:
setBufferSizein interfaceMimeResponse
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSizein interfaceMimeResponse
flushBuffer
public void flushBuffer()
- Specified by:
flushBufferin interfaceMimeResponse
resetBuffer
public void resetBuffer()
- Specified by:
resetBufferin interfaceMimeResponse
setCommitted
public void setCommitted(boolean committed)
isCommitted
public boolean isCommitted()
- Specified by:
isCommittedin interfaceMimeResponse
reset
public void reset()
- Specified by:
resetin interfaceMimeResponse
getPortletOutputStream
public OutputStream getPortletOutputStream() throws IOException
- Specified by:
getPortletOutputStreamin interfaceMimeResponse- Throws:
IOException
createRenderURL
public PortletURL createRenderURL()
- Specified by:
createRenderURLin interfaceMimeResponse
createActionURL
public PortletURL createActionURL()
- Specified by:
createActionURLin interfaceMimeResponse
createResourceURL
public ResourceURL createResourceURL()
- Specified by:
createResourceURLin interfaceMimeResponse
getCacheControl
public CacheControl getCacheControl()
- Specified by:
getCacheControlin interfaceMimeResponse
setIncludedUrl
public void setIncludedUrl(String includedUrl)
getIncludedUrl
public String getIncludedUrl()
setForwardedUrl
public void setForwardedUrl(String forwardedUrl)
getForwardedUrl
public String getForwardedUrl()