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.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 java.util.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 |
protected java.lang.Object |
populate(java.lang.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 java.util.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 java.lang.Object populate(java.lang.Object obj)
throws java.lang.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:
java.lang.Exception - if BeanUtils fails to copy properly
Copyright © 2003-2009. All Rights Reserved.