Package org.dbunit
Class AbstractDatabaseTester
java.lang.Object
org.dbunit.assertion.SimpleAssert
org.dbunit.AbstractDatabaseTester
- All Implemented Interfaces:
IDatabaseTester
- Direct Known Subclasses:
DataSourceDatabaseTester,DefaultDatabaseTester,JdbcDatabaseTester,JndiDatabaseTester
Basic implementation of IDatabaseTester.
Implementations of IDatabaseTester may use this class as a starting point.
Implementations of IDatabaseTester may use this class as a starting point.
- Since:
- 2.2.0
- Version:
- $Revision$ $Date$
- Author:
- Andres Almiray (aalmiray@users.sourceforge.net), Last changed by: $Author$
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a tester with no schema.AbstractDatabaseTester(String schema) Creates a tester for the given schema. -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseConnection(IDatabaseConnection connection) Close the specified connection.Returns the test dataset.protected StringReturns the schema value.Returns the DatabaseOperation to call when starting the test.Returns 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) Sets the listener notified of connection-retrieval and setup/tear-down events.voidSets the schema value.voidsetSetUpOperation(DatabaseOperation setUpOperation) Sets the DatabaseOperation to call when starting the test.voidsetTearDownOperation(DatabaseOperation tearDownOperation) Sets the DatabaseOperation to call when ending the test.toString()Methods inherited from class org.dbunit.assertion.SimpleAssert
assertNotNull, assertNotNull, assertNotNullNorEmpty, assertTrue, assertTrue, failMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.dbunit.IDatabaseTester
getConnection
-
Constructor Details
-
AbstractDatabaseTester
public AbstractDatabaseTester()Creates a tester with no schema. -
AbstractDatabaseTester
Creates a tester for the given schema.- Parameters:
schema- The schema to be tested. Can benull- Since:
- 2.4.3
-
-
Method Details
-
closeConnection
Description copied from interface:IDatabaseTesterClose the specified connection.- Specified by:
closeConnectionin interfaceIDatabaseTester- Parameters:
connection- the connection to close.- Throws:
Exception- if the connection cannot be closed.
-
getDataSet
Description copied from interface:IDatabaseTesterReturns the test dataset.- Specified by:
getDataSetin interfaceIDatabaseTester- Returns:
- the test dataset.
-
onSetup
Description copied from interface:IDatabaseTesterTestCases must call this method inside setUp()- Specified by:
onSetupin interfaceIDatabaseTester- Throws:
Exception- if the setup operation fails.
-
onTearDown
Description copied from interface:IDatabaseTesterTestCases must call this method inside tearDown()- Specified by:
onTearDownin interfaceIDatabaseTester- Throws:
Exception- if the tear-down operation fails.
-
setDataSet
Description copied from interface:IDatabaseTesterSets the test dataset to use.- Specified by:
setDataSetin interfaceIDatabaseTester- Parameters:
dataSet- the test dataset to use.
-
setSchema
Description copied from interface:IDatabaseTesterSets the schema value.- Specified by:
setSchemain interfaceIDatabaseTester- Parameters:
schema- the schema name.
-
setSetUpOperation
Description copied from interface:IDatabaseTesterSets the DatabaseOperation to call when starting the test.- Specified by:
setSetUpOperationin interfaceIDatabaseTester- Parameters:
setUpOperation- the setupDatabaseOperation.
-
setTearDownOperation
Description copied from interface:IDatabaseTesterSets the DatabaseOperation to call when ending the test.- Specified by:
setTearDownOperationin interfaceIDatabaseTester- Parameters:
tearDownOperation- the tear-downDatabaseOperation.
-
getSchema
Returns the schema value.- Returns:
- the schema value, or
nullif none is set.
-
getSetUpOperation
Returns the DatabaseOperation to call when starting the test.- Specified by:
getSetUpOperationin interfaceIDatabaseTester- Returns:
- the setup
DatabaseOperation.
-
getTearDownOperation
Returns the DatabaseOperation to call when ending the test.- Specified by:
getTearDownOperationin interfaceIDatabaseTester- Returns:
- the tear-down
DatabaseOperation.
-
setOperationListener
Description copied from interface:IDatabaseTesterSets the listener notified of connection-retrieval and setup/tear-down events.- Specified by:
setOperationListenerin interfaceIDatabaseTester- Parameters:
operationListener- The operation listener that is invoked on specific events in theIDatabaseTester.
-
toString
-