Package org.dbunit

Class JdbcBasedDBTestCase

All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.InvocationInterceptor, org.junit.jupiter.api.extension.TestInstantiationAwareExtension

public abstract class JdbcBasedDBTestCase extends DBTestCase
TestCase that uses a JdbcDatabaseTester.
Since:
2.2.0
Version:
$Revision$ $Date$
Author:
Andres Almiray (aalmiray@users.sourceforge.net), Felipe Leme (dbunit@felipeal.net), Last changed by: $Author$
  • Constructor Details

    • JdbcBasedDBTestCase

      public JdbcBasedDBTestCase()
    • JdbcBasedDBTestCase

      public JdbcBasedDBTestCase(String name)
  • Method Details

    • newDatabaseTester

      protected IDatabaseTester newDatabaseTester() throws ClassNotFoundException
      Creates a new IDatabaseTester.
      Default implementation returns a JdbcDatabaseTester configured with the values returned from getDriverClass(), getConnectionUrl(), getUsername() and getPassword().
      Overrides:
      newDatabaseTester in class DBTestCase
      Throws:
      ClassNotFoundException - when the driverClass was not found
    • getConnectionUrl

      protected abstract String getConnectionUrl()
      Returns the test connection url.
    • getDriverClass

      protected abstract String getDriverClass()
      Returns the JDBC driver classname.
    • getPassword

      protected String getPassword()
      Returns the password for the connection.
      Subclasses may override this method to provide a custom password.
      Default implementations returns null.
    • getUsername

      protected String getUsername()
      Returns the username for the connection.
      Subclasses may override this method to provide a custom username.
      Default implementations returns null.