org.springframework.mock.web.portlet
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 the MimeResponse
interface.
- Since:
- 3.0
- Author:
- Juergen Hoeller
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 |
request
private PortletRequest request
contentType
private java.lang.String contentType
characterEncoding
private java.lang.String characterEncoding
writer
private java.io.PrintWriter writer
locale
private java.util.Locale locale
bufferSize
private int bufferSize
outputStream
private final java.io.ByteArrayOutputStream outputStream
cacheControl
private final CacheControl cacheControl
committed
private boolean committed
includedUrl
private java.lang.String includedUrl
forwardedUrl
private java.lang.String forwardedUrl
MockMimeResponse
public MockMimeResponse()
- Create a new MockMimeResponse with a default
MockPortalContext
.
- 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
setContentType
public void setContentType(java.lang.String contentType)
- Specified by:
setContentType
in interface MimeResponse
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interface MimeResponse
setCharacterEncoding
public void setCharacterEncoding(java.lang.String characterEncoding)
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interface MimeResponse
getWriter
public java.io.PrintWriter getWriter()
throws java.io.UnsupportedEncodingException
- Specified by:
getWriter
in interface MimeResponse
- Throws:
java.io.UnsupportedEncodingException
getContentAsByteArray
public byte[] getContentAsByteArray()
getContentAsString
public java.lang.String getContentAsString()
throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
setLocale
public void setLocale(java.util.Locale locale)
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocale
in interface MimeResponse
setBufferSize
public void setBufferSize(int bufferSize)
- Specified by:
setBufferSize
in interface MimeResponse
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSize
in interface MimeResponse
flushBuffer
public void flushBuffer()
- Specified by:
flushBuffer
in interface MimeResponse
resetBuffer
public void resetBuffer()
- Specified by:
resetBuffer
in interface MimeResponse
setCommitted
public void setCommitted(boolean committed)
isCommitted
public boolean isCommitted()
- Specified by:
isCommitted
in interface MimeResponse
reset
public void reset()
- Specified by:
reset
in interface MimeResponse
getPortletOutputStream
public java.io.OutputStream getPortletOutputStream()
throws java.io.IOException
- Specified by:
getPortletOutputStream
in interface MimeResponse
- Throws:
java.io.IOException
createRenderURL
public PortletURL createRenderURL()
- Specified by:
createRenderURL
in interface MimeResponse
createActionURL
public PortletURL createActionURL()
- Specified by:
createActionURL
in interface MimeResponse
createResourceURL
public ResourceURL createResourceURL()
- Specified by:
createResourceURL
in interface MimeResponse
getCacheControl
public CacheControl getCacheControl()
- Specified by:
getCacheControl
in interface MimeResponse
setIncludedUrl
public void setIncludedUrl(java.lang.String includedUrl)
getIncludedUrl
public java.lang.String getIncludedUrl()
setForwardedUrl
public void setForwardedUrl(java.lang.String forwardedUrl)
getForwardedUrl
public java.lang.String getForwardedUrl()