public class MockFacesContext extends FacesContext
Usage:
MockFacesContext facesContext = new MockFacesContext() { public Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType) throws ELException { if ("#{myTestExpression}".equals(expression)) { return myTestResult; } return null; } }; facesContext.setCurrent(); assertNotNull(FacesContext.getCurrentInstance());
Constructor and Description |
---|
MockFacesContext() |
getCurrentInstance
public void resetVariables()
public void resetExpressions()
public void setCurrent()
public void relieveCurrent()
public Application getApplication()
getApplication
in class FacesContext
public ELContext getELContext()
getELContext
in class FacesContext
@Deprecated public Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType) throws ELException
ELException
public void addMessage(String clientId, FacesMessage message)
addMessage
in class FacesContext
public Iterator<String> getClientIdsWithMessages()
getClientIdsWithMessages
in class FacesContext
public ExternalContext getExternalContext()
getExternalContext
in class FacesContext
public FacesMessage.Severity getMaximumSeverity()
getMaximumSeverity
in class FacesContext
public Iterator<FacesMessage> getMessages()
getMessages
in class FacesContext
public Iterator<FacesMessage> getMessages(String clientId)
getMessages
in class FacesContext
public RenderKit getRenderKit()
getRenderKit
in class FacesContext
public boolean getRenderResponse()
getRenderResponse
in class FacesContext
public boolean getResponseComplete()
getResponseComplete
in class FacesContext
public ResponseStream getResponseStream()
getResponseStream
in class FacesContext
public ResponseWriter getResponseWriter()
getResponseWriter
in class FacesContext
public UIViewRoot getViewRoot()
getViewRoot
in class FacesContext
public void release()
release
in class FacesContext
public void renderResponse()
renderResponse
in class FacesContext
public void responseComplete()
responseComplete
in class FacesContext
public void setResponseStream(ResponseStream responseStream)
setResponseStream
in class FacesContext
public void setResponseWriter(ResponseWriter responseWriter)
setResponseWriter
in class FacesContext
public void setViewRoot(UIViewRoot root)
setViewRoot
in class FacesContext
Copyright © 2013 Nuxeo SA. All Rights Reserved.