Annotation Type SkipWhenDatabaseIs
@Retention(RUNTIME)
@Target({METHOD,TYPE})
@Repeatable(SkipWhenDatabaseIsMultiple.class)
public @interface SkipWhenDatabaseIs
Marker annotation that allows controlling whether specific tests are invoked based on whether
the connection is to one database type or not; optionally specifying version constraints.
While a test can be marked specifically with
SkipWhenDatabaseVersion annotations, it
is desirable to use this annotation instead to influence the skip not only based on the
version but also the database type as MariaDB and MySQL both have different version schemes
that will eventually collide.
Furthermore, the reason specified can be provided differently per database version, allowing
the test output to be as explicit as possible for why a given test is skipped as the reason
in the version takes precedence over the one at the database skip level. The database skip
reason will only be present if there are no version contraints or if all version constraits
provide no reason text.- Author:
- Chris Cranford
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionReturns which database platform this skip exclusion applies -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionReturns why the database is skipped.Returns an array of database version constraints applied to skip rule
-
Element Details
-
value
SkipWhenDatabaseIs.Type valueReturns which database platform this skip exclusion applies
-
-
-
versions
SkipWhenDatabaseVersion[] versionsReturns an array of database version constraints applied to skip rule- Default:
- {}
-
reason
String reasonReturns why the database is skipped. When specifying version constraints, the version constraint reasons will have a priority over this reason when writing the skip reason to the test output stream.- Default:
- ""
-