org.dbunit
Class JdbcBasedDBTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.dbunit.DatabaseTestCase
              extended by org.dbunit.DBTestCase
                  extended by org.dbunit.JdbcBasedDBTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class JdbcBasedDBTestCase
extends DBTestCase

TestCase that uses a JdbcDatabaseTester.

Since:
2.2.0
Version:
$Revision: 788 $ $Date: 2008-08-15 15:52:03 +0200 (Fri, 15 Aug 2008) $
Author:
Andres Almiray (aalmiray@users.sourceforge.net), Felipe Leme (dbunit@felipeal.net), Last changed by: $Author: gommma $

Constructor Summary
JdbcBasedDBTestCase()
           
JdbcBasedDBTestCase(String name)
           
 
Method Summary
protected abstract  String getConnectionUrl()
          Returns the test connection url.
protected abstract  String getDriverClass()
          Returns the JDBC driver classname.
protected  String getPassword()
          Returns the password for the connection.
Subclasses may override this method to provide a custom password.
Default implementations returns null.
protected  String getUsername()
          Returns the username for the connection.
Subclasses may override this method to provide a custom username.
Default implementations returns null.
protected  IDatabaseTester newDatabaseTester()
          Creates a new IDatabaseTester.
Default implementation returns a JdbcDatabaseTester configured with the values returned from getDriverClass(), getConnectionUrl(), getUsername() and getPassword().
 
Methods inherited from class org.dbunit.DBTestCase
getConnection
 
Methods inherited from class org.dbunit.DatabaseTestCase
closeConnection, getDatabaseTester, getDataSet, getSetUpOperation, getTearDownOperation, setUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcBasedDBTestCase

public JdbcBasedDBTestCase()

JdbcBasedDBTestCase

public JdbcBasedDBTestCase(String name)
Method Detail

newDatabaseTester

protected IDatabaseTester newDatabaseTester()
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

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.



Copyright © 2002-2012. All Rights Reserved.