public abstract 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());
Modifier and Type | Class and Description |
---|---|
class |
MockFacesContext.MockApplication |
Constructor and Description |
---|
MockFacesContext() |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(String clientId,
FacesMessage message) |
abstract Object |
evaluateExpressionGet(FacesContext context,
String expression,
Class expectedType) |
Application |
getApplication() |
Iterator<String> |
getClientIdsWithMessages() |
ExternalContext |
getExternalContext() |
FacesMessage.Severity |
getMaximumSeverity() |
Iterator<FacesMessage> |
getMessages() |
Iterator<FacesMessage> |
getMessages(String clientId) |
RenderKit |
getRenderKit() |
boolean |
getRenderResponse() |
boolean |
getResponseComplete() |
ResponseStream |
getResponseStream() |
ResponseWriter |
getResponseWriter() |
UIViewRoot |
getViewRoot() |
void |
release() |
void |
relieveCurrent() |
void |
renderResponse() |
void |
responseComplete() |
void |
setCurrent() |
void |
setResponseStream(ResponseStream responseStream) |
void |
setResponseWriter(ResponseWriter responseWriter) |
void |
setViewRoot(UIViewRoot root) |
getCurrentInstance, getELContext
public void setCurrent()
public void relieveCurrent()
public Application getApplication()
getApplication
in class FacesContext
public abstract 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 © 2011 Nuxeo SA. All Rights Reserved.