public abstract class BaseSpringTest
extends org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
By default this is auto-wired by type. If a this is going to result in a conlict the use auto-wire by name. This can be done by setting populateProtectedVariables to true in the constructor and then adding protected members with the same name as the bean you require.
| Modifier and Type | Field and Description |
|---|---|
protected org.hibernate.SessionFactory |
sessionFactory
protected so that it gets populated if autowiring is done by variable name
|
jdbcTemplatetransactionDefinition, transactionManager, transactionStatusAUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO| Constructor and Description |
|---|
BaseSpringTest()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
flushAndClear()
Forces the session to flush to the database (without commiting) and clear the
cache.
|
protected java.lang.String[] |
getConfigLocations()
Get the config locations
|
protected org.hibernate.Session |
getSession() |
protected org.springframework.context.ConfigurableApplicationContext |
loadContext(java.lang.Object key)
Ignores the key and loads the
application context. |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Setter present for in case autowiring is done by type
|
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete, setDataSource, setSqlScriptEncodingendTransaction, isDefaultRollback, isRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransactiongetAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariablescontextKey, createApplicationContext, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDownaddContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirtygetDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBarecountTestCases, createResult, getName, run, run, runTest, setName, toStringassertEquals, 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, formatprotected org.hibernate.SessionFactory sessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - protected org.hibernate.Session getSession()
protected void flushAndClear()
protected java.lang.String[] getConfigLocations()
getConfigLocations in class org.springframework.test.AbstractSingleSpringContextTestsprotected org.springframework.context.ConfigurableApplicationContext loadContext(java.lang.Object key)
throws java.lang.Exception
application context.loadContext in class org.springframework.test.AbstractSingleSpringContextTestsjava.lang.ExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.