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 theMimeResponse
interface.- 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 PortletURL
createActionURL()
PortletURL
createRenderURL()
ResourceURL
createResourceURL()
void
flushBuffer()
int
getBufferSize()
CacheControl
getCacheControl()
String
getCharacterEncoding()
byte[]
getContentAsByteArray()
String
getContentAsString()
String
getContentType()
String
getForwardedUrl()
String
getIncludedUrl()
Locale
getLocale()
OutputStream
getPortletOutputStream()
PrintWriter
getWriter()
boolean
isCommitted()
void
reset()
void
resetBuffer()
void
setBufferSize(int bufferSize)
void
setCharacterEncoding(String characterEncoding)
void
setCommitted(boolean committed)
void
setContentType(String contentType)
void
setForwardedUrl(String forwardedUrl)
void
setIncludedUrl(String includedUrl)
void
setLocale(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:
setContentType
in interfaceMimeResponse
getContentType
public String getContentType()
- Specified by:
getContentType
in interfaceMimeResponse
setCharacterEncoding
public void setCharacterEncoding(String characterEncoding)
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfaceMimeResponse
getWriter
public PrintWriter getWriter() throws UnsupportedEncodingException
- Specified by:
getWriter
in interfaceMimeResponse
- Throws:
UnsupportedEncodingException
getContentAsByteArray
public byte[] getContentAsByteArray()
getContentAsString
public String getContentAsString() throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceMimeResponse
setBufferSize
public void setBufferSize(int bufferSize)
- Specified by:
setBufferSize
in interfaceMimeResponse
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSize
in interfaceMimeResponse
flushBuffer
public void flushBuffer()
- Specified by:
flushBuffer
in interfaceMimeResponse
resetBuffer
public void resetBuffer()
- Specified by:
resetBuffer
in interfaceMimeResponse
setCommitted
public void setCommitted(boolean committed)
isCommitted
public boolean isCommitted()
- Specified by:
isCommitted
in interfaceMimeResponse
reset
public void reset()
- Specified by:
reset
in interfaceMimeResponse
getPortletOutputStream
public OutputStream getPortletOutputStream() throws IOException
- Specified by:
getPortletOutputStream
in interfaceMimeResponse
- Throws:
IOException
createRenderURL
public PortletURL createRenderURL()
- Specified by:
createRenderURL
in interfaceMimeResponse
createActionURL
public PortletURL createActionURL()
- Specified by:
createActionURL
in interfaceMimeResponse
createResourceURL
public ResourceURL createResourceURL()
- Specified by:
createResourceURL
in interfaceMimeResponse
getCacheControl
public CacheControl getCacheControl()
- Specified by:
getCacheControl
in interfaceMimeResponse
setIncludedUrl
public void setIncludedUrl(String includedUrl)
getIncludedUrl
public String getIncludedUrl()
setForwardedUrl
public void setForwardedUrl(String forwardedUrl)
getForwardedUrl
public String getForwardedUrl()