Package org.dbunit
package org.dbunit
-
ClassDescriptionBasic implementation of IDatabaseTester.
Implementations of IDatabaseTester may use this class as a starting point.Provides static methods for the most common DbUnit assertion needs.AnIOperationListenerthat forwards every callback to adelegateexcept a close of a connection whose lifecycle is owned elsewhere: it dropsoperationSetUpFinished/operationTearDownFinishedfor the connection (or connections) it protects, so thedelegate'sDefaultOperationListener-style close cannot run on one still in use for a later step - a row count check verify, a connection injected into the test method, or the shared connectionDefaultPrepAndExpectedTestCasedrives its whole lifecycle on.Convenience class for writing JUnit tests with dbunit easily.Produces a configuredIDatabaseTesterfororg.dbunit.annotation.DbUnitConfig#databaseTesterFactory().Base checked exception for errors raised by the DbUnit framework.Base unchecked exception for errors raised by the DbUnit framework.TestCase that uses a DataSourceDatabaseTester.DatabaseTester that uses aDataSourceto create connections.Base testCase for database testing.
Subclasses may overrideDBTestCase.newDatabaseTester()to plug-in a different implementation of IDatabaseTester.
Default implementation uses aPropertiesBasedJdbcDatabaseTester.Default implementation of AbstractDatabaseTester, which does not know how to get a connection by itself.Default implementation forExpectedDataSetAndVerifyTableDefinitionVerifierwhich logs the mismatches and fails the test when an expected table does not have a VerifyTableDefinition.Default implementation of theIOperationListener.Test case base class supporting prep data and expected data.Strategy pattern for verifyingVerifyTableDefinitions and expectedDataSet configurations agree, e.g. have the same number of tables defined.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).Listener forIDatabaseConnectionevents.TestCase that uses a JdbcDatabaseTester.DatabaseTester that uses JDBC's Driver Manager to create connections.TestCase that uses a JndiDatabaseTester.DatabaseTester that pulls a DataSource from a JNDI location.Aggregates thePrepAndExpectedTestCase.postTest(boolean)failures aMultiDataSourcePrepAndExpectedTestCasecollects across every involved data source, instead of stopping at the first one.Preps and verifies tables across multipleIDatabaseConnections around one run of the code under test, by fanning thePrepAndExpectedTestCaselifecycle out to one delegate per data source.Test case supporting prep data and expected data.Test steps definition; helpful for Java lambdas.The table verification definitions, prep data files, and expected data files for onePrepAndExpectedTestCaserun, bundled as a single immutable value.DatabaseTester that configures a DriverManager from environment properties.
This class defines a set of keys for system properties that need to be present in the environment before using it.Defines a database table to verify (assert on data), specifying include and exclude column filters and optionalValueComparers.Computes a catalog'sVerifyTableDefinitions forDbUnitConfig.verifyDefinitions()orDbUnitExpected.verifyDefinitions(), for the case where the definitions must be computed rather than declared as constants.