Annotation Type DbUnitConfig
-
@Retention(RUNTIME) @Inherited @Documented @Target({METHOD,TYPE}) public @interface DbUnitConfig
Annotation that can be used to customize DBUnit configuration property when the DbUnit connection will be created.For example:
@DbUnitConfig(DefaultConfig.class) public class TestClass { @Rule public DbUnitRule rule = new DbUnitRule(connectionFactory); @Test public void test1() { } @Test @DbUnitDataSet("/dataset/xml/table1.xml") public void test2() { } public static class DefaultConfig implements DbUnitConfigInterceptor { @Override public void applyConfiguration(DatabaseConfig config) { config.setProperty(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, true); } } }
- See Also:
DatabaseConfig
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
allowEmptyFields
Enable or disable empty fields in dataset.boolean
batchedStatements
Enable or disable usage of JDBC batched statement by DbUnit, default isfalse
.int
batchSize
Integer object giving the size of batch updates.boolean
caseSensitiveTableNames
Enable or disable case sensitive table names.Class<? extends org.dbunit.dataset.datatype.IDataTypeFactory>
datatypeFactory
Used to configure the DataType factory.boolean
datatypeWarning
Enable or disable the warning message displayed when DbUnit encounter an unsupported data type.int
fetchSize
Integer object giving the statement fetch size for loading data into a result set table.Class<? extends org.dbunit.database.IMetadataHandler>
metadataHandler
Used to configure the handler used to control database metadata related methods.boolean
qualifiedTableNames
Enable or disable multiple schemas support.Class<? extends DbUnitConfigInterceptor>[]
value
The interceptor class that will be instantiated and executed before applying DbUnit dataset.
-
-
-
Element Detail
-
value
Class<? extends DbUnitConfigInterceptor>[] value
The interceptor class that will be instantiated and executed before applying DbUnit dataset.- Returns:
- The interceptor class.
- Default:
- {}
-
-
-
caseSensitiveTableNames
boolean caseSensitiveTableNames
Enable or disable case sensitive table names. If enabled, Dbunit handles all table names in a case sensitive way, default isfalse
.- Returns:
- Feature activation flag.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- false
-
-
-
qualifiedTableNames
boolean qualifiedTableNames
Enable or disable multiple schemas support. If enabled, Dbunit access tables with names fully qualified by schema using this format:"SCHEMA.TABLE"
.- Returns:
- Feature activation flag.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- false
-
-
-
batchedStatements
boolean batchedStatements
Enable or disable usage of JDBC batched statement by DbUnit, default isfalse
.- Returns:
- Feature activation flag.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- false
-
-
-
allowEmptyFields
boolean allowEmptyFields
Enable or disable empty fields in dataset.- Returns:
- Feature activation flag.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- false
-
-
-
datatypeWarning
boolean datatypeWarning
Enable or disable the warning message displayed when DbUnit encounter an unsupported data type.- Returns:
- Feature activation flag.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- true
-
-
-
fetchSize
int fetchSize
Integer object giving the statement fetch size for loading data into a result set table.- Returns:
- The fetch size.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- 100
-
-
-
batchSize
int batchSize
Integer object giving the size of batch updates.- Returns:
- The batch size.
- See Also:
- http://www.dbunit.org/properties.html
- Default:
- 100
-
-
-
datatypeFactory
Class<? extends org.dbunit.dataset.datatype.IDataTypeFactory> datatypeFactory
Used to configure the DataType factory. You can replace the default factory to add support for non-standard database vendor data types. The following factories are currently available:org.dbunit.ext.db2.Db2DataTypeFactory
org.dbunit.ext.h2.H2DataTypeFactory
org.dbunit.ext.hsqldb.HsqldbDataTypeFactory
org.dbunit.ext.mckoi.MckoiDataTypeFactory
org.dbunit.ext.mssql.MsSqlDataTypeFactory
org.dbunit.ext.mysql.MySqlDataTypeFactory
org.dbunit.ext.oracle.OracleDataTypeFactory
org.dbunit.ext.oracle.Oracle10DataTypeFactory
org.dbunit.ext.postgresql.PostgresqlDataTypeFactory
org.dbunit.ext.netezza.NetezzaDataTypeFactory
IDataTypeFactory
specified here must have a no-args constructor.- Returns:
- The datatype factory.
- Default:
- org.dbunit.dataset.datatype.DefaultDataTypeFactory.class
-
-
-
metadataHandler
Class<? extends org.dbunit.database.IMetadataHandler> metadataHandler
Used to configure the handler used to control database metadata related methods. The following RDBMS specific handlers are currently available:org.dbunit.ext.db2.Db2MetadataHandler
org.dbunit.ext.mysql.MySqlMetadataHandler
org.dbunit.ext.netezza.NetezzaMetadataHandler
DefaultMetadataHandler
. Note that theIMetadataHandler
specified here must have a no-args constructor.- Returns:
- The metadata handler implementation.
- Default:
- org.dbunit.database.DefaultMetadataHandler.class
-
-