Annotation Type DbUnitInit


  • @Retention(RUNTIME)
    @Inherited
    @Documented
    @Target(TYPE)
    public @interface DbUnitInit
    DbUnit initialization: allow user to run SQL scripts before loading DbUnit data set. This annotation can be used on:
    • Class (i.e test class).
    • Package (i.e package where test classes belongs)
    For example:
    
    
       @DbUnitInit(sql = "/sql/schema.sql")
       @DbUnitDataSet("/dataset/xml")
       public class TestClass {
         @Rule
         public DbUnitRule rule = new DbUnitRule(connectionFactory);
    
         @Test
         public void test1() {
         }
       }
    
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      char delimiter
      Delimiter for these set of SQL scripts.
      String[] sql
      Set of SQL scripts to load
    • Element Detail

      • sql

        String[] sql
        Set of SQL scripts to load
        Returns:
        SQL scripts file to load.
        Default:
        {}
      • delimiter

        char delimiter
        Delimiter for these set of SQL scripts.
        Returns:
        Delimiter.
        Default:
        ';'