Annotation Interface Sql


Annotation that can be applied to a test scenario to execute SQL against a test database prior to the sceario being run.
Since:
4.1.0
Author:
Tim Yates
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The phase of the test to execute the SQL scripts.
    static @interface 
    Wrapper annotation class to allow multiple Sql annotations per test class or method.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the datasource to use for the SQL scripts.
    The phase of the test to execute the SQL scripts.
     
    Scripts to execute, e.g.
     
  • Element Details

    • value

      @AliasFor(member="scripts") String[] value
      Returns:
      The SQL scripts to execute
      Default:
      {}
    • dataSourceName

      String dataSourceName
      The name of the datasource to use for the SQL scripts.
      Returns:
      The datasource name
      Default:
      "default"
    • phase

      Sql.Phase phase
      The phase of the test to execute the SQL scripts.
      Returns:
      The phase
      Default:
      BEFORE_ALL
    • scripts

      @AliasFor(member="value") String[] scripts
      Scripts to execute, e.g. "classpath:foo.sql".
      Returns:
      The SQL scripts to execute
      Default:
      {}
    • resourceType

      Class<?> resourceType
      Returns:
      The type of the resource to use for the SQL scripts.
      Default:
      javax.sql.DataSource.class