Annotation Type DBUnit
-
@Target({METHOD,TYPE}) @Retention(RUNTIME) @Documented @Inherited public @interface DBUnit
Created by rafael-pestano on 30/08/2016. This annotation configures DBUnit properties (http://dbunit.sourceforge.net/properties.html) for a given dataset executor. It can be used at class or method level.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanallowEmptyFieldsAllow to call INSERT/UPDATE with empty strings ('').booleanalwaysCleanAfterIf enabled then cleanAfter will be enabled even if it is disabled at@DataSetlevelbooleanalwaysCleanBeforeIf enabled then cleanBefore will be enabled even if it is disabled at@DataSetlevelbooleanbatchedStatementsintbatchSizebooleancacheConnectionbooleancacheTableNamesOrthographycaseInsensitiveStrategySpecifies the orthography/letter-case strategy ifcaseSensitiveTableNames()is set tofalse(case-insensitive mode).booleancaseSensitiveTableNamesEnable or disable case sensitive table names.booleancolumnSensingIf enabled, when loading datasets, reads in the whole XML into a buffer and dynamically adds new columns as they appear.Class<? extends org.dbunit.dataset.datatype.IDataTypeFactory>dataTypeFactoryClassString[]disablePKCheckForbooleandisableSequenceFilteringIf enabled then the sequenceFiltering will be disabled even if it is enabled at@DataSetlevelStringdriverStringescapePatternAllows schema, table and column names escaping.StringexecutorRiderDataSource.DBTypeexpectedDbTypeIn the process of initialization, if the actual database type is different from the expected database type, exception will be thrown unless the expected database type isRiderDataSource.DBType.UNKNOWN.intfetchSizebooleanleakHunterbooleanmergeDataSetsDataSetMergingStrategymergingStrategyWhen dataset merging strategy is set to CLASS then we first load class level datasets and later method level datasets Default is methodClass<? extends org.dbunit.database.IMetadataHandler>metaDataHandlerStringpasswordbooleanqualifiedTableNamesbooleanraiseExceptionOnCleanUpIf enabled an exception will be raised whencleanBeforeorcleanAfterfails.Class<? extends Replacer>[]replacersStringschemaString[]tableTypeStringurlStringuser
-
-
-
Element Detail
-
executor
String executor
- Returns:
- executor id for which the properties will be setup.
- Default:
- "default"
-
-
-
raiseExceptionOnCleanUp
boolean raiseExceptionOnCleanUp
If enabled an exception will be raised whencleanBeforeorcleanAfterfails. If disabled then only a warn message is logged. Default isfalse- Returns:
- boolean value which configures case-sensitive table names (also columns)
- Since:
- 1.16.0
- Default:
- false
-
-
-
expectedDbType
RiderDataSource.DBType expectedDbType
In the process of initialization, if the actual database type is different from the expected database type, exception will be thrown unless the expected database type isRiderDataSource.DBType.UNKNOWN.Default is
RiderDataSource.DBType.UNKNOWN.- Returns:
- the expected database type.
- Since:
- 1.16.0
- Default:
- com.github.database.rider.core.connection.RiderDataSource.DBType.UNKNOWN
-
-
-
dataTypeFactoryClass
Class<? extends org.dbunit.dataset.datatype.IDataTypeFactory> dataTypeFactoryClass
- Returns:
- value which configures DatabaseConfig.PROPERTY_DATATYPE_FACTORY
- Default:
- org.dbunit.dataset.datatype.IDataTypeFactory.class
-
-
-
metaDataHandler
Class<? extends org.dbunit.database.IMetadataHandler> metaDataHandler
- Returns:
- value which configures DatabaseConfig.PROPERTY_METADATA_HANDLER
- Default:
- org.dbunit.database.IMetadataHandler.class
-
-
-
caseInsensitiveStrategy
Orthography caseInsensitiveStrategy
Specifies the orthography/letter-case strategy ifcaseSensitiveTableNames()is set tofalse(case-insensitive mode). IfcaseSensitiveTableNames()=false, then this property is ignored and has no effect. Defaults toOrthography.UPPERCASE.
This is a database-rider internal property and not related to dbunit.- Returns:
- The
Orthographyconstant - Since:
- 1.2.0
- Default:
- com.github.database.rider.core.api.configuration.Orthography.UPPERCASE
-
-
-
mergeDataSets
boolean mergeDataSets
- Returns:
- Enable or disable dataset merging. If enabled then datasets declared at class/test level AND method will be merged into one dataset to seed database. Note that only array properties of @DataSet annotation like 'value' and 'executeStatementsBefore' will be merged.
- Default:
- false
-
-
-
mergingStrategy
DataSetMergingStrategy mergingStrategy
When dataset merging strategy is set to CLASS then we first load class level datasets and later method level datasets Default is method- Default:
- com.github.database.rider.core.api.configuration.DataSetMergingStrategy.METHOD
-
-
-
columnSensing
boolean columnSensing
If enabled, when loading datasets, reads in the whole XML into a buffer and dynamically adds new columns as they appear. This way, it's not necessary to define all possible columns on the first line.- Returns:
- Enables or disables column sensing. Defaults to false.
- Default:
- false
-
-
-
escapePattern
String escapePattern
Allows schema, table and column names escaping. The property value is an escape pattern where the ? is replaced by the name. For example, the pattern "[?]" is expanded as "[MY_TABLE]" for a table named "MY_TABLE". The most common escape pattern is "\"?\"" which surrounds the table name with quotes (for the above example it would result in "\"MY_TABLE\""). As a fallback if no questionmark is in the given String and its length is one it is used to surround the table name on the left and right side. For example the escape pattern "\"" will have the same effect as the escape pattern "\"?\"".- Returns:
- value which configures DatabaseConfig.PROPERTY_ESCAPE_PATTERN. Defaults to none
- Default:
- ""
-
-
-
tableType
String[] tableType
- Returns:
- value which configures DatabaseConfig.PROPERTY_TABLE_TYPE (http://www.dbunit.org/properties/tableType)
- Since:
- 1.17.0
- Default:
- {"TABLE"}
-
-
-
disablePKCheckFor
String[] disablePKCheckFor
- Returns:
- list of table names to disable primary key check while creating the dataset.
- Since:
- 1.21.0
- Default:
- {}
-
-
-
driver
String driver
- Returns:
- driver class name. Used for declarative connections. Don't needed for drivers that implement jdbc 4.
- Since:
- 0.15.0
- Default:
- ""
-
-
-
url
String url
- Returns:
- Database url. Used for declarative connections.
- Since:
- 0.15.0
- Default:
- ""
-
-
-
user
String user
- Returns:
- Username owner of database connection. Used for declarative connection.
- Since:
- 0.15.0
- Default:
- ""
-
-
-
password
String password
- Returns:
- Password of owner of database connection. Used for declarative connection.
- Since:
- 0.15.0
- Default:
- ""
-
-
-
schema
String schema
- Returns:
- Schema for the database connection.
- Since:
- 1.11.0
- Default:
- ""
-
-