org.appfuse.dao
Class BaseDaoTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.test.AbstractTransactionalSpringContextTests
                              extended by org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                  extended by org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
                                      extended by org.springframework.test.jpa.AbstractJpaTests
                                          extended by org.appfuse.dao.BaseDaoTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class BaseDaoTestCase
extends org.springframework.test.jpa.AbstractJpaTests

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.jpa.AbstractJpaTests
entityManagerFactory, sharedEntityManager
 
Fields inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
profileValueSource, simpleJdbcTemplate
 
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
 
Constructor Summary
BaseDaoTestCase()
          Default constructor - populates "rb" variable if properties file exists for the class in src/test/resources.
 
Method Summary
protected  java.lang.String[] getConfigLocations()
          Sets AutowireMode to AUTOWIRE_BY_NAME and configures all context files needed to tests DAOs.
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.jpa.AbstractJpaTests
cacheKeys, createContainerManagedEntityManager, createShadowingClassLoader, customizeResourceOverridingShadowingClassLoader, getActualOrmXmlLocation, runBare, setDirty, setEntityManagerFactory, shouldUseShadowLoader
 
Methods inherited from class org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests
findUniqueProfileValueSourceFromContext, getTestMethod, isDisabledInThisEnvironment, isRollback, setDataSource
 
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete
 
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, onSetUp, onSetUpBeforeTransaction, onSetUpInTransaction, onTearDown, 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, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
 
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled
 
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
 

Field Detail

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)

Constructor Detail

BaseDaoTestCase

public BaseDaoTestCase()
Default constructor - populates "rb" variable if properties file exists for the class in src/test/resources.

Method Detail

getConfigLocations

protected java.lang.String[] getConfigLocations()
Sets AutowireMode to AUTOWIRE_BY_NAME and configures all context files needed to tests DAOs.

Overrides:
getConfigLocations in class org.springframework.test.AbstractSingleSpringContextTests
Returns:
String array of Spring context files.

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-2007. All Rights Reserved.