Annotation Interface PrepareDatabase
Annotation used by the
DatabaseExtension to define the setup and teardown SQL scripts.
This annotation may be applied at the class level, providing default behavior for all tests, and/or it may be provided
at the test method level to add or override configuration data.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanDefines whether the setup and teardown scripts will be added to or overrides of any defined at the class level.Defines the method (by name) on the test instance (static or non-static) which will be executed to create theDataSourceinstance used by the extension.Defines the method (by name) on the test instance (static or non-static) which will be executed to destroy theDataSourceinstance used by the extension.String[]A list of setup SQL scripts which will be run in order to setup the database.String[]A list of tear-down SQL scripts which will be run in order to tear down the database.
-
Element Details
-
creator
String creatorDefines the method (by name) on the test instance (static or non-static) which will be executed to create theDataSourceinstance used by the extension. The method must return aDataSourceinstance.- Returns:
- the DataSource create method.
- Default:
- ""
-
setup
String[] setupA list of setup SQL scripts which will be run in order to setup the database.- Returns:
- the list of scripts
- Default:
- {""}
-
teardown
String[] teardownA list of tear-down SQL scripts which will be run in order to tear down the database.- Returns:
- the list of scripts
- Default:
- {""}
-
additive
boolean additiveDefines whether the setup and teardown scripts will be added to or overrides of any defined at the class level.- Returns:
- whether the scripts are additive or overriding
- Default:
- true
-
destroyer
String destroyerDefines the method (by name) on the test instance (static or non-static) which will be executed to destroy theDataSourceinstance used by the extension. The method must accept aDataSourceparameter.- Returns:
- the name of the method used to destroy the DataSource
- Default:
- ""
-