Package org.dbunit
Class DBTestCase
java.lang.Object
org.dbunit.DatabaseTestCase
org.dbunit.DBTestCase
- All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension,org.junit.jupiter.api.extension.InvocationInterceptor,org.junit.jupiter.api.extension.TestInstantiationAwareExtension
- Direct Known Subclasses:
DataSourceBasedDBTestCase,DefaultPrepAndExpectedTestCase,JdbcBasedDBTestCase,JndiBasedDBTestCase
Base testCase for database testing.
Subclasses may override
Default implementation uses a
Subclasses may override
newDatabaseTester() to plug-in a different implementation
of IDatabaseTester.Default implementation uses a
PropertiesBasedJdbcDatabaseTester.- Since:
- 2.2.0
- Version:
- $Revision$ $Date$
- Author:
- Felipe Leme (dbunit@felipeal.net), Last changed by: $Author$
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor
org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope -
Constructor Summary
ConstructorsConstructorDescriptionCreates a testCase with no name.DBTestCase(String name) Creates a testCase with the given name. -
Method Summary
Modifier and TypeMethodDescriptionprotected final IDatabaseConnectionReturns the test database connection.protected IDatabaseTesterCreates a new IDatabaseTester.Methods inherited from class org.dbunit.DatabaseTestCase
closeConnection, getDatabaseTester, getDataSet, getName, getOperationListener, getSetUpOperation, getTearDownOperation, setUp, setUpDatabaseConfig, tearDown, tearDownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor
interceptAfterAllMethod, interceptAfterEachMethod, interceptBeforeAllMethod, interceptBeforeEachMethod, interceptDynamicTest, interceptTestClassConstructor, interceptTestFactoryMethod, interceptTestMethod, interceptTestTemplateMethodMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Constructor Details
-
DBTestCase
public DBTestCase()Creates a testCase with no name. -
DBTestCase
Creates a testCase with the given name.- Parameters:
name- the test case name.
-
-
Method Details
-
getConnection
Description copied from class:DatabaseTestCaseReturns the test database connection.- Specified by:
getConnectionin classDatabaseTestCase- Returns:
- the test database connection.
- Throws:
Exception- if the connection cannot be retrieved or created.
-
newDatabaseTester
Creates a new IDatabaseTester. Default implementation returns aPropertiesBasedJdbcDatabaseTester.- Overrides:
newDatabaseTesterin classDatabaseTestCase- Returns:
- the newly created database tester.
- Throws:
Exception- if the database tester cannot be created.
-