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() |
getCurrentInstancepublic void resetVariables()
public void resetExpressions()
public void setCurrent()
public void relieveCurrent()
public Application getApplication()
getApplication in class FacesContextpublic ELContext getELContext()
getELContext in class FacesContext@Deprecated public Object evaluateExpressionGet(FacesContext context, String expression, Class expectedType) throws ELException
ELExceptionpublic void addMessage(String clientId, FacesMessage message)
addMessage in class FacesContextpublic Iterator<String> getClientIdsWithMessages()
getClientIdsWithMessages in class FacesContextpublic ExternalContext getExternalContext()
getExternalContext in class FacesContextpublic FacesMessage.Severity getMaximumSeverity()
getMaximumSeverity in class FacesContextpublic Iterator<FacesMessage> getMessages()
getMessages in class FacesContextpublic Iterator<FacesMessage> getMessages(String clientId)
getMessages in class FacesContextpublic RenderKit getRenderKit()
getRenderKit in class FacesContextpublic boolean getRenderResponse()
getRenderResponse in class FacesContextpublic boolean getResponseComplete()
getResponseComplete in class FacesContextpublic ResponseStream getResponseStream()
getResponseStream in class FacesContextpublic ResponseWriter getResponseWriter()
getResponseWriter in class FacesContextpublic UIViewRoot getViewRoot()
getViewRoot in class FacesContextpublic void release()
release in class FacesContextpublic void renderResponse()
renderResponse in class FacesContextpublic void responseComplete()
responseComplete in class FacesContextpublic void setResponseStream(ResponseStream responseStream)
setResponseStream in class FacesContextpublic void setResponseWriter(ResponseWriter responseWriter)
setResponseWriter in class FacesContextpublic void setViewRoot(UIViewRoot root)
setViewRoot in class FacesContextCopyright © 2013 Nuxeo SA. All Rights Reserved.