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 Summary
Modifier and TypeMethodDescriptionvoidCleanup tables specified in prep and expected datasets, using the provided databaseTester.voidconfigureTest(VerifyTableDefinition[] verifyTableDefinitions, String[] prepDataFiles, String[] expectedDataFiles) Configure the test.Get the expected dataset, created from the expectedDataFiles.Get the prep dataset, created from the prepDataFiles.voidpostTest()Execute all post-test steps.voidpostTest(boolean verifyData) Execute post-test steps.voidpreTest()Execute pre-test steps.voidpreTest(VerifyTableDefinition[] verifyTables, String[] prepDataFiles, String[] expectedDataFiles) Convenience method to call configureTest() and preTest().runTest(VerifyTableDefinition[] verifyTables, String[] prepDataFiles, String[] expectedDataFiles, PrepAndExpectedTestCaseSteps testSteps) Run the DbUnit test.voidFor the provided VerifyTableDefinitions, verify each table's actual results are as expected.
-
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
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
Execute all post-test steps. Call this method after performing the test steps.- Throws:
Exception
-
postTest
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
For the provided VerifyTableDefinitions, verify each table's actual results are as expected.- Throws:
Exception
-
cleanupData
Cleanup tables specified in prep and expected datasets, using the provided databaseTester. SeeIDatabaseTester.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.
-