Package org.dbunit

Interface PrepAndExpectedTestCase

All Known Implementing Classes:
DefaultPrepAndExpectedTestCase

public interface PrepAndExpectedTestCase
Test case supporting prep data and expected data.
Since:
2.4.8
Version:
$Revision$ $Date$
Author:
Jeff Jensen jeffjensen AT users.sourceforge.net, Last changed by: $Author$
  • Method Details

    • configureTest

      void configureTest(VerifyTableDefinition[] verifyTableDefinitions, String[] prepDataFiles, String[] expectedDataFiles) throws Exception
      Configure the test. Call this method before performing the test steps.
      Parameters:
      verifyTableDefinitions - Table definitions to verify after test execution.
      prepDataFiles - The prep data files (as classpath resources) to load and insert contents into the database as seed data.
      expectedDataFiles - The expected data files (as classpath resources) to load as expected data and verify actual data matches at test end.
      Throws:
      Exception
    • preTest

      void preTest() throws Exception
      Execute pre-test steps. Call this method before performing the test steps.
      Throws:
      Exception
    • preTest

      void preTest(VerifyTableDefinition[] verifyTables, String[] prepDataFiles, String[] expectedDataFiles) throws Exception
      Convenience method to call configureTest() and preTest().
      Parameters:
      verifyTables - Table definitions to verify after test execution.
      prepDataFiles - The prep data files (as classpath resources) to load and insert contents into the database as seed data.
      expectedDataFiles - The expected data files (as classpath resources) to load as expected data and verify actual data matches at test end.
      Throws:
      Exception
    • runTest

      Object runTest(VerifyTableDefinition[] verifyTables, String[] prepDataFiles, String[] expectedDataFiles, PrepAndExpectedTestCaseSteps testSteps) throws Exception
      Run the DbUnit test.
      Parameters:
      verifyTables - Table definitions to verify after test execution.
      prepDataFiles - The prep data files (as classpath resources) to load and insert contents into the database as seed data.
      expectedDataFiles - The expected data files (as classpath resources) to load as expected data and verify actual data matches at test end.
      testSteps - The test steps to run.
      Returns:
      User defined object from running the test steps.
      Throws:
      Exception
      Since:
      2.5.2
    • postTest

      void postTest() throws Exception
      Execute all post-test steps. Call this method after performing the test steps.
      Throws:
      Exception
    • postTest

      void postTest(boolean verifyData) throws Exception
      Execute post-test steps. Call this method after performing the test steps.
      Parameters:
      verifyData - Specify true to perform verify data steps, false to not. Useful to specify false when test has failure in progress (e.g. an exception) and verifying data would fail, masking original test failure.
      Throws:
      Exception
    • verifyData

      void verifyData() throws Exception
      For the provided VerifyTableDefinitions, verify each table's actual results are as expected.
      Throws:
      Exception
    • cleanupData

      void cleanupData() throws Exception
      Cleanup tables specified in prep and expected datasets, using the provided databaseTester. See IDatabaseTester.onTearDown().
      Throws:
      Exception
    • getPrepDataset

      IDataSet getPrepDataset()
      Get the prep dataset, created from the prepDataFiles.
      Returns:
      The prep dataset.
    • getExpectedDataset

      IDataSet getExpectedDataset()
      Get the expected dataset, created from the expectedDataFiles.
      Returns:
      The expected dataset.