The Spring Framework

org.springframework.test.annotation
Class AbstractAnnotationAwareTransactionalTests

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
All Implemented Interfaces:
Test
Direct Known Subclasses:
AbstractJpaTests

public abstract class AbstractAnnotationAwareTransactionalTests
extends AbstractTransactionalDataSourceSpringContextTests

Java 5 specific subclass of AbstractTransactionalDataSourceSpringContextTests, exposing a SimpleJdbcTemplate and obeying annotations for transaction control.

For example, test methods can be annotated with the regular Spring Transactional annotation (for example, to force execution in a read-only transaction) or with the NotTransactional annotation to prevent any transaction being created at all.

Since:
2.0
Author:
Rod Johnson

Field Summary
protected  ProfileValueSource profileValueSource
           
protected  SimpleJdbcTemplate 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
AbstractAnnotationAwareTransactionalTests()
           
 
Method Summary
protected  void findUniqueProfileValueSourceFromContext(ApplicationContext ac)
           
protected  boolean isDisabledInThisEnvironment(Method testMethod)
           
 void runBare()
          Overridden to populate transaction definition from annotations.
 void setDataSource(DataSource dataSource)
          Setter: DataSource is provided by Dependency Injection.
 
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, deleteFromTables, executeSqlScript, getJdbcTemplate, setComplete
 
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, 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, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, setDirty, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

simpleJdbcTemplate

protected SimpleJdbcTemplate simpleJdbcTemplate

profileValueSource

protected ProfileValueSource profileValueSource
Constructor Detail

AbstractAnnotationAwareTransactionalTests

public AbstractAnnotationAwareTransactionalTests()
Method Detail

setDataSource

public void setDataSource(DataSource dataSource)
Description copied from class: AbstractTransactionalDataSourceSpringContextTests
Setter: DataSource is provided by Dependency Injection.

Overrides:
setDataSource in class AbstractTransactionalDataSourceSpringContextTests

findUniqueProfileValueSourceFromContext

protected void findUniqueProfileValueSourceFromContext(ApplicationContext ac)

runBare

public void runBare()
             throws Throwable
Overridden to populate transaction definition from annotations.

Overrides:
runBare in class ConditionalTestCase
Throws:
Throwable

isDisabledInThisEnvironment

protected boolean isDisabledInThisEnvironment(Method testMethod)

The Spring Framework

Copyright © 2002-2007 The Spring Framework.