org.dbunit
Class DatabaseTestCase

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

public abstract class DatabaseTestCase
extends junit.framework.TestCase

Since:
Feb 17, 2002 TODO: mark it as deprecated use #{DBTestCase} instead.
Version:
$Revision: 788 $
Author:
Manuel Laflamme

Constructor Summary
DatabaseTestCase()
           
DatabaseTestCase(java.lang.String name)
           
 
Method Summary
protected  void closeConnection(IDatabaseConnection connection)
          Close the specified connection.
protected abstract  IDatabaseConnection getConnection()
          Returns the test database connection.
protected  IDatabaseTester getDatabaseTester()
          Gets the IDatabaseTester for this testCase.
protected abstract  IDataSet getDataSet()
          Returns the test dataset.
protected  DatabaseOperation getSetUpOperation()
          Returns the database operation executed in test setup.
protected  DatabaseOperation getTearDownOperation()
          Returns the database operation executed in test cleanup.
protected  IDatabaseTester newDatabaseTester()
          Creates a IDatabaseTester for this testCase.
protected  void setUp()
           
protected  void 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

DatabaseTestCase

public DatabaseTestCase()

DatabaseTestCase

public DatabaseTestCase(java.lang.String name)
Method Detail

getConnection

protected abstract IDatabaseConnection getConnection()
                                              throws java.lang.Exception
Returns the test database connection.

Throws:
java.lang.Exception

getDataSet

protected abstract IDataSet getDataSet()
                                throws java.lang.Exception
Returns the test dataset.

Throws:
java.lang.Exception

newDatabaseTester

protected IDatabaseTester newDatabaseTester()
                                     throws java.lang.Exception
Creates a IDatabaseTester for this testCase.
A DefaultDatabaseTester is used by default.

Throws:
java.lang.Exception

getDatabaseTester

protected IDatabaseTester getDatabaseTester()
                                     throws java.lang.Exception
Gets the IDatabaseTester for this testCase.
If the IDatabaseTester is not set yet, this method calls newDatabaseTester() to obtain a new instance.

Throws:
java.lang.Exception

closeConnection

protected void closeConnection(IDatabaseConnection connection)
                        throws java.lang.Exception
Close the specified connection. Override this method of you want to keep your connection alive between tests.

Throws:
java.lang.Exception

getSetUpOperation

protected DatabaseOperation getSetUpOperation()
                                       throws java.lang.Exception
Returns the database operation executed in test setup.

Throws:
java.lang.Exception

getTearDownOperation

protected DatabaseOperation getTearDownOperation()
                                          throws java.lang.Exception
Returns the database operation executed in test cleanup.

Throws:
java.lang.Exception

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception


Copyright © 2002-2008. All Rights Reserved.