Using DB Sanity
You can call Databene DB Sanity for checking preconditions before starting data generation and for verifying properness of the generated data in the end. For detailed information about DB Sanity, check its project homepage: https://sourceforge.net/projects/dbsanity/. To use its functionality in Benerator, download and install dbsanity4ben from https://sourceforge.net/projects/dbsanity/files/.
For calling DB Sanity in a Benerator descriptor file, you define the checks and put them into a single XML file or distribute them over several ones and put them into a subdirectory of your Benerator project, typically called ' dbsanity'.
Import the plugin functionality to your Benerator project using
Then you can call DB Sanity providing a reference to a database you have declared before:
<database id="db" … />
<dbsanity database="db" />
Alternatively, you can specify the environment and use a new database connection to perform data verification:
<dbsanity environment="mytestdb" />
You have the following configuration options:
|The environment name with the configuration of the database to verify (see 'Database' for environment definition).
|The database to verify
|The directory from which to read the
|The directory in which to put the report
|An application version for which to perform the checks
|Comma-separated list of tables on which to restrict the checks
|Comma-separated list of tags on which to restrict the checks
|The DB sanity skin to use for reports
|The locale in which to render values
|DB Sanity's execution mode
|Configures how to react to a requirements violation
|See 'Error Handling'