|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.test.mock.MockedJsfTestContainer
public class MockedJsfTestContainer
Field Summary | |
---|---|
protected MockApplication |
application
|
protected MockServletConfig |
config
|
protected MockExternalContext |
externalContext
|
protected MockFacesContext |
facesContext
|
protected MockFacesContextFactory |
facesContextFactory
|
protected MockHttpSession |
lastSession
|
protected MockLifecycle |
lifecycle
|
protected MockLifecycleFactory |
lifecycleFactory
|
protected MockRenderKit |
renderKit
|
protected MockHttpServletRequest |
request
|
protected boolean |
requestInitializedCalled
|
protected MockHttpServletResponse |
response
|
protected MockServletContext |
servletContext
|
Constructor Summary | |
---|---|
MockedJsfTestContainer()
Construct a new instance of this test case. |
Method Summary | |
---|---|
protected void |
doRequestDestroyed()
|
protected void |
doRequestInitialized()
|
void |
endRequest()
This method call doRequestDestroyed() and then tearDownRequest(). |
void |
endSession()
|
MockApplication |
getApplication()
|
MockExternalContext |
getExternalContext()
|
MockFacesContext |
getFacesContext()
|
protected Locale |
getLocale()
|
MockHttpServletRequest |
getRequest()
|
MockHttpServletResponse |
getResponse()
|
MockServletContext |
getServletContext()
|
MockWebContainer |
getWebContainer()
|
void |
sessionCreated(javax.servlet.http.HttpSessionEvent se)
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
|
protected void |
setFactories()
Set JSF factories using FactoryFinder method setFactory. |
void |
setUp()
Set up instance variables required by this test case. |
void |
setUpAll()
|
protected void |
setUpApplication()
Setup the application variable and before
the end by default it is assigned to the facesContext
variable, calling facesContext.setApplication(application) |
protected void |
setUpDefaultView()
By default, create an instance of UIViewRoot, set its viewId as "/viewId" and assign it to the current facesContext. |
protected void |
setUpFacesContext()
Setup the facesContextFactory and facesContext
variable. |
protected void |
setUpJSFObjects()
Setup JSF object used for the test. |
protected void |
setUpLifecycle()
Setup the lifecycle and lifecycleFactory
variables. |
protected void |
setUpRenderKit()
Setup the renderKit variable. |
protected void |
setUpRequest()
Setup servlet objects that will be used for the test: |
protected void |
setUpServletContext()
Setup servlet objects that will be used for the test: |
void |
startRequest()
|
void |
startSession()
|
void |
tearDown()
Tear down instance variables required by this test case. |
void |
tearDownAll()
|
protected void |
tearDownRequest()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MockApplication application
protected MockServletConfig config
protected MockExternalContext externalContext
protected MockFacesContext facesContext
protected MockFacesContextFactory facesContextFactory
protected MockLifecycle lifecycle
protected MockLifecycleFactory lifecycleFactory
protected MockRenderKit renderKit
protected MockHttpServletRequest request
protected boolean requestInitializedCalled
protected MockHttpServletResponse response
protected MockHttpSession lastSession
protected MockServletContext servletContext
Constructor Detail |
---|
public MockedJsfTestContainer()
Construct a new instance of this test case.
name
- Name of this test caseMethod Detail |
---|
public void setUp()
Set up instance variables required by this test case.
public void setUpAll()
public void tearDownAll()
protected void setUpJSFObjects()
Setup JSF object used for the test. By default it calls to the following methods in this order:
setUpLifecycle();
setUpApplication();
setUpRenderKit();
Exception
protected void setUpServletContext()
Setup servlet objects that will be used for the test:
config
(MockServletConfig
)servletContext
(MockServletContext
)
Exception
protected void setUpRequest()
Setup servlet objects that will be used for the test:
request
(MockHttpServletRequest
response
(MockHttpServletResponse
)
Exception
protected void doRequestInitialized()
public void startRequest()
public void startSession()
public void endSession()
public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
sessionCreated
in interface javax.servlet.http.HttpSessionListener
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
protected void setFactories()
Set JSF factories using FactoryFinder method setFactory.
Exception
protected void setUpLifecycle()
lifecycle
and lifecycleFactory
variables.
Exception
protected void setUpFacesContext()
facesContextFactory
and facesContext
variable. Before end, by default it override externalContext
variable from the value retrieved from facesContext.getExternalContext(),
because sometimes it is possible facesContext overrides externalContext
internally.
Exception
protected void setUpDefaultView()
Exception
protected Locale getLocale()
protected void setUpApplication()
application
variable and before
the end by default it is assigned to the facesContext
variable, calling facesContext.setApplication(application)
Exception
protected void setUpRenderKit()
renderKit
variable. This is a good place to use
ConfigParser
to register converters, validators, components
or renderkits.
Exception
public MockApplication getApplication()
public MockExternalContext getExternalContext()
public MockFacesContext getFacesContext()
public MockHttpServletRequest getRequest()
public MockHttpServletResponse getResponse()
public MockServletContext getServletContext()
public MockWebContainer getWebContainer()
public final void endRequest()
protected void doRequestDestroyed()
protected void tearDownRequest()
public void tearDown()
Tear down instance variables required by this test case.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |