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
Direct Known Subclasses:
MockRenderResponse, MockResourceResponse

public class MockMimeResponse
extends MockPortletResponse

Mock implementation of the javax.portlet.MimeResponse interface.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
private  int bufferSize
           
private  CacheControl cacheControl
           
private  java.lang.String characterEncoding
           
private  boolean committed
           
private  java.lang.String contentType
           
private  java.lang.String forwardedUrl
           
private  java.lang.String includedUrl
           
private  java.util.Locale locale
           
private  java.io.ByteArrayOutputStream outputStream
           
private  PortletRequest request
           
private  java.io.PrintWriter writer
           
 
Constructor Summary
MockMimeResponse()
          Create a new MockMimeResponse with a default MockPortalContext.
MockMimeResponse(PortalContext portalContext)
          Create a new MockMimeResponse.
MockMimeResponse(PortalContext portalContext, PortletRequest request)
          Create a new MockMimeResponse.
 
Method Summary
 PortletURL createActionURL()
           
 PortletURL createRenderURL()
           
 ResourceURL createResourceURL()
           
 void flushBuffer()
           
 int getBufferSize()
           
 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
 

Field Detail

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
Constructor Detail

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 WindowStates
request - the corresponding render/resource request that this response is being generated for
Method Detail

setContentType

public void setContentType(java.lang.String contentType)

getContentType

public java.lang.String getContentType()

setCharacterEncoding

public void setCharacterEncoding(java.lang.String characterEncoding)

getCharacterEncoding

public java.lang.String getCharacterEncoding()

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.UnsupportedEncodingException
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()

setBufferSize

public void setBufferSize(int bufferSize)

getBufferSize

public int getBufferSize()

flushBuffer

public void flushBuffer()

resetBuffer

public void resetBuffer()

setCommitted

public void setCommitted(boolean committed)

isCommitted

public boolean isCommitted()

reset

public void reset()

getPortletOutputStream

public java.io.OutputStream getPortletOutputStream()
                                            throws java.io.IOException
Throws:
java.io.IOException

createRenderURL

public PortletURL createRenderURL()

createActionURL

public PortletURL createActionURL()

createResourceURL

public ResourceURL createResourceURL()

getCacheControl

public CacheControl getCacheControl()

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()