Class DbUnitTaskIT

java.lang.Object
org.dbunit.ant.DbUnitTaskIT

public class DbUnitTaskIT extends Object
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:
  • invalid reference
    org.dbunit.ant.AntTest
  • Field Details

  • Constructor Details

    • DbUnitTaskIT

      public DbUnitTaskIT()
  • Method Details

    • initializeDbEnvironment

      @BeforeAll public static void initializeDbEnvironment() throws Exception
      Throws:
      Exception
    • setUp

      @BeforeEach public void setUp() throws Exception
      Throws:
      Exception
    • tearDown

      @AfterEach public void tearDown() throws Exception
      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:
      SQLException
      DatabaseUnitException
    • 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

      @Test public void testEscapePattern_withEscapePatternTarget_setsEscapePattern() throws Exception
      Throws:
      Exception
    • testDataTypeFactoryViaGenericConfig_withGenericConfigTarget_setsFactoryAndProperties

      @Test public void testDataTypeFactoryViaGenericConfig_withGenericConfigTarget_setsFactoryAndProperties() throws Exception
      Throws:
      Exception
    • testClasspath_withInvalidUrl_throwsBuildExceptionWithSqlCause

      @Test public void testClasspath_withInvalidUrl_throwsBuildExceptionWithSqlCause() throws Exception
      Throws:
      Exception
    • testDriverNotInClasspath_withDriverAbsent_throwsBuildExceptionWithClassNotFoundCause

      @Test public void testDriverNotInClasspath_withDriverAbsent_throwsBuildExceptionWithClassNotFoundCause() throws Exception
      Throws:
      Exception
    • testReplaceOperation_withReplaceTarget_updatesFirstRowToNull

      @Test public void testReplaceOperation_withReplaceTarget_updatesFirstRowToNull() throws Exception
      Throws:
      Exception
    • testOrderedOperation_withOrderedTarget_insertsRowsInOrder

      @Test public void testOrderedOperation_withOrderedTarget_insertsRowsInOrder() throws Exception
      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

      protected int getQueryCount(List tables)
    • getTableCount

      protected int getTableCount(List tables)
    • getQuerySetCount

      protected int getQuerySetCount(List tables)
    • getFirstStepFromTarget

      protected DbUnitTaskStep getFirstStepFromTarget(String targetName)
    • getStepFromTarget

      protected DbUnitTaskStep getStepFromTarget(String targetName, int index)
    • expectSpecificBuildException

      public void expectSpecificBuildException(String target, String cause, String msg)
      Runs a target, wait for a build exception.
      Parameters:
      target - target to run
      cause - information string to reader of report
      msg - the message value of the build exception we are waiting for set to null for any build exception to be valid
    • expectBuildException

      public void expectBuildException(String target, String cause)