Package org.dbunit
Interface IDatabaseTester
- All Known Implementing Classes:
AbstractDatabaseTester,DataSourceDatabaseTester,DefaultDatabaseTester,JdbcDatabaseTester,JndiDatabaseTester,PropertiesBasedJdbcDatabaseTester
public interface IDatabaseTester
This interface defines the behavior of a DatabaseTester, which is responsible
for adding DBUnit features as composition on existing test cases (instead of
extending DBTestCase directly).
- Since:
- 2.2.0
- Version:
- $Revision$ $Date$
- Author:
- Andres Almiray (aalmiray@users.sourceforge.net), Last changed by: $Author$
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseConnection(IDatabaseConnection connection) Deprecated.Returns the test database connection.Returns the test dataset.Gets the DatabaseOperation to call when starting the test.Gets the DatabaseOperation to call when ending the test.voidonSetup()TestCases must call this method inside setUp()voidTestCases must call this method inside tearDown()voidsetDataSet(IDataSet dataSet) Sets the test dataset to use.voidsetOperationListener(IOperationListener operationListener) voidDeprecated.since 2.4.3 Should not be used anymore.voidsetSetUpOperation(DatabaseOperation setUpOperation) Sets the DatabaseOperation to call when starting the test.voidsetTearDownOperation(DatabaseOperation tearDownOperation) Sets the DatabaseOperation to call when ending the test.
-
Method Details
-
closeConnection
Deprecated.since 2.4.4 define a user definedsetOperationListener(IOperationListener)in advanceClose the specified connection.- Throws:
Exception
-
getConnection
Returns the test database connection.- Throws:
Exception
-
getDataSet
IDataSet getDataSet()Returns the test dataset. -
getSetUpOperation
DatabaseOperation getSetUpOperation()Gets the DatabaseOperation to call when starting the test. -
getTearDownOperation
DatabaseOperation getTearDownOperation()Gets the DatabaseOperation to call when ending the test. -
setDataSet
Sets the test dataset to use. -
setSchema
Deprecated.since 2.4.3 Should not be used anymore. Every concreteIDatabaseTesterimplementation that needs a schema has the possibility to set it somehow in the constructorSets the schema value. -
setSetUpOperation
Sets the DatabaseOperation to call when starting the test. -
setTearDownOperation
Sets the DatabaseOperation to call when ending the test. -
onSetup
TestCases must call this method inside setUp()- Throws:
Exception
-
onTearDown
TestCases must call this method inside tearDown()- Throws:
Exception
-
setOperationListener
- Parameters:
operationListener- The operation listener that is invoked on specific events in theIDatabaseTester.- Since:
- 2.4.4
-
setOperationListener(IOperationListener)in advance