Package org.dbunit.ant
Class DbUnitTaskIT
java.lang.Object
org.dbunit.ant.DbUnitTaskIT
Ant-based test class for the Dbunit ant task definition.
- Since:
- Jun 10, 2002
- Version:
- $Revision$ $Date$
- Author:
- Timothy Ruppert, Ben Cox, Last changed by: $Author$
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertOperationType(String failMessage, String targetName, DatabaseOperation expected) voidexpectBuildException(String target, String cause) voidexpectSpecificBuildException(String target, String cause, String msg) Runs a target, wait for a build exception.protected DbUnitTaskStepgetFirstStepFromTarget(String targetName) protected intgetQueryCount(List tables) protected intgetQuerySetCount(List tables) protected DbUnitTaskStepgetStepFromTarget(String targetName, int index) protected intgetTableCount(List tables) static voidvoidsetUp()voidtearDown()voidvoidvoidvoidvoidvoidTests the exception that is thrown when the compare fails because the source format was different from the previous "export" task's write format.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Field Details
-
rule
-
classUnderTest
-
-
Constructor Details
-
DbUnitTaskIT
public DbUnitTaskIT()
-
-
Method Details
-
initializeDbEnvironment
- Throws:
Exception
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testNoDriver_withMissingDriverAttribute_throwsBuildException
@Test public void testNoDriver_withMissingDriverAttribute_throwsBuildException() -
testNoDbUrl_withMissingUrlAttribute_throwsBuildException
@Test public void testNoDbUrl_withMissingUrlAttribute_throwsBuildException() -
testNoUserid_withMissingUseridAttribute_throwsBuildException
@Test public void testNoUserid_withMissingUseridAttribute_throwsBuildException() -
testNoPassword_withMissingPasswordAttribute_throwsBuildException
@Test public void testNoPassword_withMissingPasswordAttribute_throwsBuildException() -
testInvalidDatabaseInformation_withBadConnectionInfo_causeIsSqlException
@Test public void testInvalidDatabaseInformation_withBadConnectionInfo_causeIsSqlException() -
testInvalidOperationType_withUnknownType_causeIsIllegalArgumentException
@Test public void testInvalidOperationType_withUnknownType_causeIsIllegalArgumentException() -
testSetFlatFalse_withXmlFormatAttribute_returnsXmlFormat
@Test public void testSetFlatFalse_withXmlFormatAttribute_returnsXmlFormat() -
testResolveOperationTypes_withAllOperationTypeNames_resolvesCorrectOperations
@Test public void testResolveOperationTypes_withAllOperationTypeNames_resolvesCorrectOperations() -
testInvalidCompositeOperationSrc_withNestedSrcAttribute_throwsBuildException
@Test public void testInvalidCompositeOperationSrc_withNestedSrcAttribute_throwsBuildException() -
testInvalidCompositeOperationFlat_withNestedFormatAttribute_throwsBuildException
@Test public void testInvalidCompositeOperationFlat_withNestedFormatAttribute_throwsBuildException() -
testExportFull_withFullExportTarget_returnsFlatFormatEmptyTableList
@Test public void testExportFull_withFullExportTarget_returnsFlatFormatEmptyTableList() -
testExportPartial_withTwoTableExport_returnsTwoTableNames
@Test public void testExportPartial_withTwoTableExport_returnsTwoTableNames() -
testExportWithForwardOnlyResultSetTable_withForwardOnlyConfig_setsForwardOnlyFactory
@Test public void testExportWithForwardOnlyResultSetTable_withForwardOnlyConfig_setsForwardOnlyFactory() throws SQLException, DatabaseUnitException- Throws:
SQLExceptionDatabaseUnitException
-
testExportFlat_withFlatFormatTarget_returnsFlatFormat
@Test public void testExportFlat_withFlatFormatTarget_returnsFlatFormat() -
testExportFlatWithDocytpe_withDoctypeSet_returnsFlatFormatAndDoctype
@Test public void testExportFlatWithDocytpe_withDoctypeSet_returnsFlatFormatAndDoctype() -
testExportFlatWithEncoding_withEncodingSet_returnsFlatFormatAndIso8859Encoding
@Test public void testExportFlatWithEncoding_withEncodingSet_returnsFlatFormatAndIso8859Encoding() -
testExportXml_withXmlFormatTarget_returnsXmlFormat
@Test public void testExportXml_withXmlFormatTarget_returnsXmlFormat() -
testExportCsv_withCsvFormatTarget_returnsCsvFormat
@Test public void testExportCsv_withCsvFormatTarget_returnsCsvFormat() -
testExportDtd_withDtdFormatTarget_returnsDtdFormat
@Test public void testExportDtd_withDtdFormatTarget_returnsDtdFormat() -
testInvalidExportFormat_withInvalidFormatAttribute_throwsBuildException
@Test public void testInvalidExportFormat_withInvalidFormatAttribute_throwsBuildException() -
testExportXmlOrdered_withOrderedXmlExport_returnsFilteredDataSet
@Test public void testExportXmlOrdered_withOrderedXmlExport_returnsFilteredDataSet() throws Exception- Throws:
Exception
-
testExportQuery_withQueryExportTarget_returnsQueriesWithSql
@Test public void testExportQuery_withQueryExportTarget_returnsQueriesWithSql() -
testExportWithQuerySet_withQuerySetTarget_returnsQuerySetsTablesAndQueries
@Test public void testExportWithQuerySet_withQuerySetTarget_returnsQuerySetsTablesAndQueries() -
testWithBadQuerySet_withBothIdAndRefid_throwsBuildException
@Disabled("Ant now ignores id errors and refid is always evaluated first") @Test public void testWithBadQuerySet_withBothIdAndRefid_throwsBuildException() -
testWithReferenceQuerySet_withRefidQuerySet_returnsQueriesFromReference
@Test public void testWithReferenceQuerySet_withRefidQuerySet_returnsQueriesFromReference() -
testExportQueryMixed_withMixedTableAndQueryExport_returnsBothTypes
@Test public void testExportQueryMixed_withMixedTableAndQueryExport_returnsBothTypes() -
testExportAndCompareFormatMismatch_withMismatchedFormats_throwsDatabaseUnitException
@Test public void testExportAndCompareFormatMismatch_withMismatchedFormats_throwsDatabaseUnitException()Tests the exception that is thrown when the compare fails because the source format was different from the previous "export" task's write format. -
testDataTypeFactory_withOracleDataTypeFactory_setsOracleFactory
@Test public void testDataTypeFactory_withOracleDataTypeFactory_setsOracleFactory() throws Exception- Throws:
Exception
-
testEscapePattern_withEscapePatternTarget_setsEscapePattern
- Throws:
Exception
-
testDataTypeFactoryViaGenericConfig_withGenericConfigTarget_setsFactoryAndProperties
@Test public void testDataTypeFactoryViaGenericConfig_withGenericConfigTarget_setsFactoryAndProperties() throws Exception- Throws:
Exception
-
testClasspath_withInvalidUrl_throwsBuildExceptionWithSqlCause
- Throws:
Exception
-
testDriverNotInClasspath_withDriverAbsent_throwsBuildExceptionWithClassNotFoundCause
@Test public void testDriverNotInClasspath_withDriverAbsent_throwsBuildExceptionWithClassNotFoundCause() throws Exception- Throws:
Exception
-
testReplaceOperation_withReplaceTarget_updatesFirstRowToNull
- Throws:
Exception
-
testOrderedOperation_withOrderedTarget_insertsRowsInOrder
- Throws:
Exception
-
testReplaceOrderedOperation_withReplaceOrderedTarget_updatesFirstRowToNull
@Test public void testReplaceOrderedOperation_withReplaceOrderedTarget_updatesFirstRowToNull() throws Exception- Throws:
Exception
-
assertOperationType
protected void assertOperationType(String failMessage, String targetName, DatabaseOperation expected) -
getQueryCount
-
getTableCount
-
getQuerySetCount
-
getFirstStepFromTarget
-
getStepFromTarget
-
expectSpecificBuildException
Runs a target, wait for a build exception.- Parameters:
target- target to runcause- information string to reader of reportmsg- the message value of the build exception we are waiting for set to null for any build exception to be valid
-
expectBuildException
-