Class DbUnitLoadingRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class DbUnitLoadingRule
    extends DbSetupRule
    This rule permits to load data into database via DbUnit framework. It benefits of the useful rule DbSetupRule.
    Author:
    Yohann Chastagnier
    • Constructor Detail

      • DbUnitLoadingRule

        public DbUnitLoadingRule​(String tableCreationSqlScript,
                                 String xmlDataSet)
        Mandatory constructor.
        Parameters:
        tableCreationSqlScript - the name of the file, without path, which contains the scripts of table creation. If the file is not in the same package of the integration test class, then the complete path of the resource (from the maven target test resources) must be given ( org/silverpeas/general.properties for example).
        xmlDataSet - the name of the file which contains the data to load into the database (the name of file without path or the complete path, same behaviour than tableCreationSqlScript
    • Method Detail

      • performBefore

        protected void performBefore​(org.junit.runner.Description description)
        Overrides:
        performBefore in class DbSetupRule