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 Details

    • closeConnection

      @Deprecated void closeConnection(IDatabaseConnection connection) throws Exception
      Deprecated.
      since 2.4.4 define a user defined setOperationListener(IOperationListener) in advance
      Close the specified connection.
      Throws:
      Exception
    • getConnection

      IDatabaseConnection getConnection() throws Exception
      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

      void setDataSet(IDataSet dataSet)
      Sets the test dataset to use.
    • setSchema

      @Deprecated void setSchema(String schema)
      Deprecated.
      since 2.4.3 Should not be used anymore. Every concrete IDatabaseTester implementation that needs a schema has the possibility to set it somehow in the constructor
      Sets the schema value.
    • setSetUpOperation

      void setSetUpOperation(DatabaseOperation setUpOperation)
      Sets the DatabaseOperation to call when starting the test.
    • setTearDownOperation

      void setTearDownOperation(DatabaseOperation tearDownOperation)
      Sets the DatabaseOperation to call when ending the test.
    • onSetup

      void onSetup() throws Exception
      TestCases must call this method inside setUp()
      Throws:
      Exception
    • onTearDown

      void onTearDown() throws Exception
      TestCases must call this method inside tearDown()
      Throws:
      Exception
    • setOperationListener

      void setOperationListener(IOperationListener operationListener)
      Parameters:
      operationListener - The operation listener that is invoked on specific events in the IDatabaseTester.
      Since:
      2.4.4