org.springframework.mock.web.portlet
Class MockMimeResponse

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

public class MockMimeResponse
extends MockPortletResponse
implements javax.portlet.MimeResponse

Mock implementation of the MimeResponse 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
MockMimeResponse()
          Create a new MockMimeResponse with a default MockPortalContext.
MockMimeResponse(javax.portlet.PortalContext portalContext)
          Create a new MockMimeResponse.
MockMimeResponse(javax.portlet.PortalContext portalContext, javax.portlet.PortletRequest request)
          Create a new MockMimeResponse.
 
Method Summary
 javax.portlet.PortletURL createActionURL()
           
 javax.portlet.PortletURL createRenderURL()
           
 javax.portlet.ResourceURL createResourceURL()
           
 void flushBuffer()
           
 int getBufferSize()
           
 javax.portlet.CacheControl getCacheControl()
           
 java.lang.String getCharacterEncoding()
           
 byte[] getContentAsByteArray()
           
 java.lang.String getContentAsString()
           
 java.lang.String getContentType()
           
 java.lang.String getForwardedUrl()
           
 java.lang.String getIncludedUrl()
           
 java.util.Locale getLocale()
           
 java.io.OutputStream getPortletOutputStream()
           
 java.io.PrintWriter getWriter()
           
 boolean isCommitted()
           
 void reset()
           
 void resetBuffer()
           
 void setBufferSize(int bufferSize)
           
 void setCharacterEncoding(java.lang.String characterEncoding)
           
 void setCommitted(boolean committed)
           
 void setContentType(java.lang.String contentType)
           
 void setForwardedUrl(java.lang.String forwardedUrl)
           
 void setIncludedUrl(java.lang.String includedUrl)
           
 void setLocale(java.util.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 default MockPortalContext.

See Also:
MockPortalContext

MockMimeResponse

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

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

MockMimeResponse

public MockMimeResponse(javax.portlet.PortalContext portalContext,
                        javax.portlet.PortletRequest request)
Create a new MockMimeResponse.

Parameters:
portalContext - the PortalContext defining the supported PortletModes and WindowStates
request - the corresponding render/resource request that this response is being generated for
Method Detail

setContentType

public void setContentType(java.lang.String contentType)
Specified by:
setContentType in interface javax.portlet.MimeResponse

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.portlet.MimeResponse

setCharacterEncoding

public void setCharacterEncoding(java.lang.String characterEncoding)

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface javax.portlet.MimeResponse

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.UnsupportedEncodingException
Specified by:
getWriter in interface javax.portlet.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 javax.portlet.MimeResponse

setBufferSize

public void setBufferSize(int bufferSize)
Specified by:
setBufferSize in interface javax.portlet.MimeResponse

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface javax.portlet.MimeResponse

flushBuffer

public void flushBuffer()
Specified by:
flushBuffer in interface javax.portlet.MimeResponse

resetBuffer

public void resetBuffer()
Specified by:
resetBuffer in interface javax.portlet.MimeResponse

setCommitted

public void setCommitted(boolean committed)

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in interface javax.portlet.MimeResponse

reset

public void reset()
Specified by:
reset in interface javax.portlet.MimeResponse

getPortletOutputStream

public java.io.OutputStream getPortletOutputStream()
                                            throws java.io.IOException
Specified by:
getPortletOutputStream in interface javax.portlet.MimeResponse
Throws:
java.io.IOException

createRenderURL

public javax.portlet.PortletURL createRenderURL()
Specified by:
createRenderURL in interface javax.portlet.MimeResponse

createActionURL

public javax.portlet.PortletURL createActionURL()
Specified by:
createActionURL in interface javax.portlet.MimeResponse

createResourceURL

public javax.portlet.ResourceURL createResourceURL()
Specified by:
createResourceURL in interface javax.portlet.MimeResponse

getCacheControl

public javax.portlet.CacheControl getCacheControl()
Specified by:
getCacheControl in interface javax.portlet.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()