java.lang.Object | ||||||||
↳ | junit.framework.Assert | |||||||
↳ | junit.framework.TestCase | |||||||
↳ | org.springframework.test.ConditionalTestCase | |||||||
↳ | org.springframework.test.AbstractSpringContextTests | |||||||
↳ | org.springframework.test.AbstractSingleSpringContextTests | |||||||
↳ | org.springframework.test.AbstractDependencyInjectionSpringContextTests | |||||||
↳ | org.springframework.test.AbstractTransactionalSpringContextTests | |||||||
↳ | org.springframework.test.AbstractTransactionalDataSourceSpringContextTests |
Known Direct Subclasses |
Known Indirect Subclasses |
This class is deprecated.
as of Spring 3.0, in favor of using the listener-based test context framework
(AbstractJUnit38SpringContextTests
)
Subclass of AbstractTransactionalSpringContextTests that adds some convenience functionality for JDBC access. Expects a javax.sql.DataSource bean to be defined in the Spring application context.
This class exposes a JdbcTemplate
and provides an easy way to delete from the database in a new transaction.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.AbstractDependencyInjectionSpringContextTests
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
jdbcTemplate |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.AbstractTransactionalSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractSingleSpringContextTests
| |||||||||||
From class
org.springframework.test.ConditionalTestCase
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor for AbstractTransactionalDataSourceSpringContextTests.
| |||||||||||
Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the JdbcTemplate that this base class manages.
| |||||||||||
Setter: DataSource is provided by Dependency Injection.
| |||||||||||
Specify the encoding for SQL scripts, if different from the platform encoding.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Count the rows in the given table
| |||||||||||
Convenient method to delete all rows from these tables.
| |||||||||||
Execute the given SQL script.
| |||||||||||
Overridden to prevent the transaction committing if a number of tables have been
cleared, as a defensive measure against accidental permanent wiping of a database.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.AbstractTransactionalSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractDependencyInjectionSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractSingleSpringContextTests
| |||||||||||
From class
org.springframework.test.AbstractSpringContextTests
| |||||||||||
From class
org.springframework.test.ConditionalTestCase
| |||||||||||
From class
junit.framework.TestCase
| |||||||||||
From class
junit.framework.Assert
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
junit.framework.Test
|
Default constructor for AbstractTransactionalDataSourceSpringContextTests.
Constructor for AbstractTransactionalDataSourceSpringContextTests with a JUnit name.
Setter: DataSource is provided by Dependency Injection.
Specify the encoding for SQL scripts, if different from the platform encoding.
Count the rows in the given table
tableName | table name to count rows in |
---|
Convenient method to delete all rows from these tables.
Calling this method will make avoidance of rollback by calling
setComplete()
impossible.
Execute the given SQL script. Will be rolled back by default, according to the fate of the current transaction.
sqlResourcePath | Spring resource path for the SQL script.
Should normally be loaded by classpath.
Statements should be delimited with a semicolon. If statements are not delimited with a semicolon then there should be one statement per line. Statements are allowed to span lines only if they are delimited with a semicolon. Do not use this method to execute DDL if you expect rollback. |
---|---|
continueOnError | whether or not to continue without throwing an exception in the event of an error |
DataAccessException | if there is an error executing a statement and continueOnError was false |
---|
Overridden to prevent the transaction committing if a number of tables have been cleared, as a defensive measure against accidental permanent wiping of a database.