org.apache.myfaces.test.mock
Class MockExternalContext20

java.lang.Object
  extended by javax.faces.context.ExternalContext
      extended by org.apache.myfaces.test.mock.MockExternalContext
          extended by org.apache.myfaces.test.mock.MockExternalContext12
              extended by org.apache.myfaces.test.mock.MockExternalContext20

public class MockExternalContext20
extends MockExternalContext12

Mock implementation of ExternalContext that includes the semantics added by JavaServer Faces 2.0.

Since:
1.0.0
Author:
Leonardo Uribe

Field Summary
 
Fields inherited from class org.apache.myfaces.test.mock.MockExternalContext
context, request, response
 
Fields inherited from class javax.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
MockExternalContext20(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 void addResponseCookie(String name, String value, Map<String,Object> properties)
           
 void addResponseHeader(String name, String value)
           
 String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
           
 String encodePartialActionURL(String url)
           
 String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
           
 String getContextName()
           
 javax.faces.context.Flash getFlash()
           
 String getMimeType(String file)
           
 String getRealPath(String path)
           
 int getRequestContentLength()
           
 String getRequestScheme()
           
 String getRequestServerName()
           
 int getRequestServerPort()
           
 int getResponseBufferSize()
           
 OutputStream getResponseOutputStream()
           
 Writer getResponseOutputWriter()
           
 void invalidateSession()
           
 boolean isResponseCommitted()
           
 void responseFlushBuffer()
           
 void responseReset()
           
 void responseSendError(int statusCode, String message)
           
 void setResponseBufferSize(int size)
           
 void setResponseContentLength(int length)
           
 void setResponseContentType(String contentType)
           
 void setResponseHeader(String name, String value)
           
 void setResponseStatus(int statusCode)
           
 
Methods inherited from class org.apache.myfaces.test.mock.MockExternalContext12
getRequestCharacterEncoding, getRequestContentType, getResponseCharacterEncoding, getResponseContentType, setRequest, setRequestCharacterEncoding, setResponse, setResponseCharacterEncoding
 
Methods inherited from class org.apache.myfaces.test.mock.MockExternalContext
addRequestCookieMap, addRequestHeader, addRequestParameterMap, dispatch, encodeActionURL, encodeNamespace, encodeResourceURL, getApplicationMap, getAuthType, getContext, getInitParameter, getInitParameterMap, getRemoteUser, getRequest, getRequestContextPath, getRequestCookieMap, getRequestHeaderMap, getRequestHeaderValuesMap, getRequestLocale, getRequestLocales, getRequestMap, getRequestParameterMap, getRequestParameterNames, getRequestParameterValuesMap, getRequestPathInfo, getRequestServletPath, getResource, getResourceAsStream, getResourcePaths, getResponse, getSession, getSessionMap, getUserPrincipal, isUserInRole, log, log, redirect, setRequestCookieMap, setRequestHeaderMap, setRequestParameterMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockExternalContext20

public MockExternalContext20(javax.servlet.ServletContext context,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
Method Detail

getMimeType

public String getMimeType(String file)
Overrides:
getMimeType in class javax.faces.context.ExternalContext

encodeBookmarkableURL

public String encodeBookmarkableURL(String baseUrl,
                                    Map<String,List<String>> parameters)
Overrides:
encodeBookmarkableURL in class javax.faces.context.ExternalContext

encodeRedirectURL

public String encodeRedirectURL(String baseUrl,
                                Map<String,List<String>> parameters)
Overrides:
encodeRedirectURL in class javax.faces.context.ExternalContext

encodePartialActionURL

public String encodePartialActionURL(String url)
Overrides:
encodePartialActionURL in class javax.faces.context.ExternalContext

getContextName

public String getContextName()
Overrides:
getContextName in class javax.faces.context.ExternalContext

getRealPath

public String getRealPath(String path)
Overrides:
getRealPath in class javax.faces.context.ExternalContext

responseSendError

public void responseSendError(int statusCode,
                              String message)
                       throws IOException
Overrides:
responseSendError in class javax.faces.context.ExternalContext
Throws:
IOException

setResponseHeader

public void setResponseHeader(String name,
                              String value)
Overrides:
setResponseHeader in class javax.faces.context.ExternalContext

getRequestScheme

public String getRequestScheme()
Overrides:
getRequestScheme in class javax.faces.context.ExternalContext

getRequestServerName

public String getRequestServerName()
Overrides:
getRequestServerName in class javax.faces.context.ExternalContext

getRequestServerPort

public int getRequestServerPort()
Overrides:
getRequestServerPort in class javax.faces.context.ExternalContext

getResponseOutputStream

public OutputStream getResponseOutputStream()
                                     throws IOException
Overrides:
getResponseOutputStream in class javax.faces.context.ExternalContext
Throws:
IOException

getResponseOutputWriter

public Writer getResponseOutputWriter()
                               throws IOException
Overrides:
getResponseOutputWriter in class javax.faces.context.ExternalContext
Throws:
IOException

setResponseContentType

public void setResponseContentType(String contentType)
Overrides:
setResponseContentType in class javax.faces.context.ExternalContext

getFlash

public javax.faces.context.Flash getFlash()
Overrides:
getFlash in class javax.faces.context.ExternalContext

setResponseContentLength

public void setResponseContentLength(int length)
Overrides:
setResponseContentLength in class javax.faces.context.ExternalContext

getRequestContentLength

public int getRequestContentLength()
Overrides:
getRequestContentLength in class javax.faces.context.ExternalContext

getResponseBufferSize

public int getResponseBufferSize()
Overrides:
getResponseBufferSize in class javax.faces.context.ExternalContext

setResponseBufferSize

public void setResponseBufferSize(int size)
Overrides:
setResponseBufferSize in class javax.faces.context.ExternalContext

setResponseStatus

public void setResponseStatus(int statusCode)
Overrides:
setResponseStatus in class javax.faces.context.ExternalContext

invalidateSession

public void invalidateSession()
Overrides:
invalidateSession in class javax.faces.context.ExternalContext

isResponseCommitted

public boolean isResponseCommitted()
Overrides:
isResponseCommitted in class javax.faces.context.ExternalContext

responseFlushBuffer

public void responseFlushBuffer()
                         throws IOException
Overrides:
responseFlushBuffer in class javax.faces.context.ExternalContext
Throws:
IOException

responseReset

public void responseReset()
Overrides:
responseReset in class javax.faces.context.ExternalContext

addResponseCookie

public void addResponseCookie(String name,
                              String value,
                              Map<String,Object> properties)
Overrides:
addResponseCookie in class javax.faces.context.ExternalContext

addResponseHeader

public void addResponseHeader(String name,
                              String value)
Overrides:
addResponseHeader in class javax.faces.context.ExternalContext


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.