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, getELContextpublic void setCurrent()
public void relieveCurrent()
public Application getApplication()
getApplication in class FacesContextpublic abstract 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 © 2011 Nuxeo SA. All Rights Reserved.