org.appfuse.dao
Class BaseDaoTestCase
java.lang.Object
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
org.appfuse.dao.BaseDaoTestCase
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
@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
Base class for running DAO tests.
- Author:
- mraible
|
Field Summary |
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) |
| Fields inherited from class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests |
simpleJdbcTemplate |
| Fields inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests |
applicationContext, logger |
|
Constructor Summary |
BaseDaoTestCase()
Default constructor - populates "rb" variable if properties file exists for the class in
src/test/resources. |
|
Method Summary |
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 |
| Methods inherited from class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests |
countRowsInTable, deleteFromTables, executeSqlScript, setDataSource, setSqlScriptEncoding |
| Methods inherited from class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests |
setApplicationContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
- Log variable for all child classes. Uses LogFactory.getLog(getClass()) from Commons Logging
rb
protected ResourceBundle rb
- ResourceBundle loaded from src/test/resources/${package.name}/ClassName.properties (if exists)
BaseDaoTestCase
public BaseDaoTestCase()
- Default constructor - populates "rb" variable if properties file exists for the class in
src/test/resources.
populate
protected Object populate(Object obj)
throws Exception
- Utility method to populate a javabean-style object with values
from a Properties file
- Parameters:
obj - the model object to populate
- Returns:
- Object populated object
- Throws:
Exception - if BeanUtils fails to copy properly
flushSearchIndexes
public void flushSearchIndexes()
- Flush search indexes, to be done after a reindex() or reindexAll() operation
Copyright © 2003-2012. All Rights Reserved.