org.appfuse.webapp.action
Class BasePageTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.springframework.test.ConditionalTestCase
org.springframework.test.AbstractSpringContextTests
org.springframework.test.AbstractSingleSpringContextTests
org.springframework.test.AbstractDependencyInjectionSpringContextTests
org.springframework.test.AbstractTransactionalSpringContextTests
org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
org.appfuse.webapp.action.BasePageTestCase
- All Implemented Interfaces:
- junit.framework.Test
public abstract class BasePageTestCase
- extends org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
Abstract JUnit 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 onSetUp() and onTearDown() 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.
NOTE: This class is a copy of Shale's AbstractJsfTestCase,
except it extends Spring's AbstractTransactionalDataSourceSpringContextTests
instead of JUnit's TestCase.
|
Field Summary |
protected org.apache.shale.test.mock.MockApplication |
application
|
protected org.apache.shale.test.mock.MockServletConfig |
config
|
protected org.apache.shale.test.mock.MockExternalContext |
externalContext
|
protected org.apache.shale.test.mock.MockFacesContext |
facesContext
|
protected org.apache.shale.test.mock.MockFacesContextFactory |
facesContextFactory
|
protected org.apache.shale.test.mock.MockLifecycle |
lifecycle
|
protected org.apache.shale.test.mock.MockLifecycleFactory |
lifecycleFactory
|
protected org.apache.commons.logging.Log |
log
|
protected static java.lang.String |
MESSAGES
|
protected org.apache.shale.test.mock.MockRenderKit |
renderKit
|
protected org.apache.shale.test.mock.MockHttpServletRequest |
request
|
protected org.apache.shale.test.mock.MockHttpServletResponse |
response
|
protected org.apache.shale.test.mock.MockServletContext |
servletContext
|
protected org.apache.shale.test.mock.MockHttpSession |
session
|
| Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests |
jdbcTemplate |
| Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests |
transactionDefinition, transactionManager, transactionStatus |
| Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests |
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO |
| Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests |
applicationContext |
| Fields inherited from class org.springframework.test.ConditionalTestCase |
logger |
|
Method Summary |
protected java.lang.String[] |
getConfigLocations()
|
protected void |
onSetUp()
Set up instance variables required by this test case. |
protected void |
onTearDown()
Tear down instance variables required by this test case. |
| Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests |
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setDataSource |
| Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests |
endTransaction, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction |
| Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests |
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables |
| Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests |
contextKey, createApplicationContext, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, setDirty, setUp, tearDown |
| Methods inherited from class org.springframework.test.AbstractSpringContextTests |
addContext, contextKeyString, getContext, hasCachedContext, setDirty |
| Methods inherited from class org.springframework.test.ConditionalTestCase |
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare |
| 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, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
MESSAGES
protected static final java.lang.String MESSAGES
- See Also:
- Constant Field Values
application
protected org.apache.shale.test.mock.MockApplication application
config
protected org.apache.shale.test.mock.MockServletConfig config
externalContext
protected org.apache.shale.test.mock.MockExternalContext externalContext
facesContext
protected org.apache.shale.test.mock.MockFacesContext facesContext
facesContextFactory
protected org.apache.shale.test.mock.MockFacesContextFactory facesContextFactory
lifecycle
protected org.apache.shale.test.mock.MockLifecycle lifecycle
lifecycleFactory
protected org.apache.shale.test.mock.MockLifecycleFactory lifecycleFactory
renderKit
protected org.apache.shale.test.mock.MockRenderKit renderKit
request
protected org.apache.shale.test.mock.MockHttpServletRequest request
response
protected org.apache.shale.test.mock.MockHttpServletResponse response
servletContext
protected org.apache.shale.test.mock.MockServletContext servletContext
session
protected org.apache.shale.test.mock.MockHttpSession session
BasePageTestCase
public BasePageTestCase()
onSetUp
protected void onSetUp()
throws java.lang.Exception
Set up instance variables required by this test case.
- Overrides:
onSetUp in class org.springframework.test.AbstractTransactionalSpringContextTests
- Throws:
java.lang.Exception
onTearDown
protected void onTearDown()
throws java.lang.Exception
Tear down instance variables required by this test case.
- Overrides:
onTearDown in class org.springframework.test.AbstractTransactionalSpringContextTests
- Throws:
java.lang.Exception
getConfigLocations
protected java.lang.String[] getConfigLocations()
- Overrides:
getConfigLocations in class org.springframework.test.AbstractSingleSpringContextTests
Copyright ? 2003-2007. All Rights Reserved.