public abstract class AbstractJmockJsfTestCase
extends org.jmock.cglib.MockObjectTestCase
Abstract JMock test case base class, which sets up the JavaServer Faces
mock object environment for a particular simulated request. The following
protected variables are initialized in the setUp()
method, and
cleaned up in the tearDown()
method:
application
(MockApplication
)config
(MockServletConfig
)externalContext
(MockExternalContext
)facesContext
(MockFacesContext
)lifecycle
(MockLifecycle
)request
(MockHttpServletRequest
response
(MockHttpServletResponse
)servletContext
(MockServletContext
)session
(MockHttpSession
)In addition, appropriate factory classes will have been registered with
javax.faces.FactoryFinder
for Application
and
RenderKit
instances. The created FacesContext
instance will also have been registered in the apppriate thread local
variable, to simulate what a servlet container would do.
WARNING - If you choose to subclass this class, be sure
your setUp()
and tearDown()
methods call
super.setUp()
and super.tearDown()
respectively,
and that you implement your own suite()
method that exposes
the test methods for your test case.
Modifier and Type | Field and Description |
---|---|
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 MockHttpServletResponse |
response |
protected MockServletContext |
servletContext |
protected MockHttpSession |
session |
Constructor and Description |
---|
AbstractJmockJsfTestCase(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
setUp() |
protected void |
tearDown() |
mock, mock, newCoreMock, newCoreMock
atLeastOnce, atMostOnce, defaultMockNameForType, doAll, doAll, doAll, doAll, exactly, mock, mock, never, never, newDummy, newDummy, newDummy, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnIterator, returnIterator, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException
and, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, collectionContaining, collectionContaining, compatibleType, contains, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, hasProperty, hasProperty, isA, isIn, isIn, mapContaining, mapContaining, mapWithKey, mapWithKey, mapWithValue, mapWithValue, not, or, same, startsWith, stringContains, toString
registerToVerify, runBare, unregisterToVerify, verify
countTestCases, createResult, getName, run, run, runTest, setName, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
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 MockHttpServletResponse response
protected MockServletContext servletContext
protected MockHttpSession session
public AbstractJmockJsfTestCase(String name)
Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.