@ContextConfiguration(locations={"classpath:/applicationContext-resources.xml","classpath:/applicationContext-dao.xml","classpath*:/applicationContext.xml","classpath:**/applicationContext*.xml"})
public abstract class BaseDaoTestCase
extends org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log
Log variable for all child classes.
|
protected ResourceBundle |
rb
ResourceBundle loaded from src/test/resources/${package.name}/ClassName.properties (if exists)
|
| Constructor and Description |
|---|
BaseDaoTestCase()
Default constructor - populates "rb" variable if properties file exists for the class in
src/test/resources.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
flush()
Create a HibernateTemplate from the SessionFactory and call flush() and clear() on it.
|
void |
flushSearchIndexes()
Flush search indexes, to be done after a reindex() or reindexAll() operation
|
protected Object |
populate(Object obj)
Utility method to populate a javabean-style object with values
from a Properties file
|
countRowsInTable, countRowsInTableWhere, deleteFromTables, deleteFromTableWhere, dropTables, executeSqlScript, setDataSource, setSqlScriptEncodingprotected final org.apache.commons.logging.Log log
protected ResourceBundle rb
public BaseDaoTestCase()
protected Object populate(Object obj) throws Exception
obj - the model object to populateException - if BeanUtils fails to copy properlyprotected void flush()
throws org.springframework.beans.BeansException
org.springframework.beans.BeansException - when can't find 'sessionFactory' beanpublic void flushSearchIndexes()
Copyright © 2003–2013. All rights reserved.