org.apache.shale.test.jmock
Class AbstractJmockJsfTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.jmock.core.VerifyingTestCase
org.jmock.core.MockObjectSupportTestCase
org.jmock.MockObjectTestCase
org.jmock.cglib.MockObjectTestCase
org.apache.shale.test.jmock.AbstractJmockJsfTestCase
- All Implemented Interfaces:
- junit.framework.Test
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.
Fields inherited from class org.jmock.core.MockObjectSupportTestCase |
ANYTHING, NOT_NULL, NULL |
Methods inherited from class org.jmock.cglib.MockObjectTestCase |
newCoreMock |
Methods inherited from class org.jmock.MockObjectTestCase |
atLeastOnce, defaultMockNameForType, mock, mock, never, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException |
Methods inherited from class org.jmock.core.MockObjectSupportTestCase |
and, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, isA, newDummy, newDummy, newDummy, not, or, same, stringContains |
Methods inherited from class org.jmock.core.VerifyingTestCase |
registerToVerify, runBare, unregisterToVerify, verify |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
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 |
application
protected MockApplication application
config
protected MockServletConfig config
externalContext
protected MockExternalContext externalContext
facesContext
protected MockFacesContext facesContext
facesContextFactory
protected MockFacesContextFactory facesContextFactory
lifecycle
protected MockLifecycle lifecycle
lifecycleFactory
protected MockLifecycleFactory lifecycleFactory
renderKit
protected MockRenderKit renderKit
request
protected MockHttpServletRequest request
response
protected MockHttpServletResponse response
servletContext
protected MockServletContext servletContext
session
protected MockHttpSession session
AbstractJmockJsfTestCase
public AbstractJmockJsfTestCase(String name)
setUp
protected void setUp()
throws Exception
- Overrides:
setUp
in class junit.framework.TestCase
- Throws:
Exception
tearDown
protected void tearDown()
throws Exception
- Overrides:
tearDown
in class junit.framework.TestCase
- Throws:
Exception
Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.