private void liquibaseDropAll(Application application) {
   Liquibase liquibase = null;
   try {
     liquibase = newLiquibase(application);
     liquibase.dropAll();
   } catch (ClassNotFoundException | LiquibaseException | SQLException ex) {
     throw new WervalException("Unable to drop database data: " + ex.getMessage(), ex);
   } finally {
     closeLiquibaseSilently(liquibase);
   }
 }
Exemple #2
0
 public void setUp(String contexts) {
   try {
     ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
     Class.forName("org.hsqldb.jdbcDriver");
     holdingConnection = getConnectionImpl();
     HsqlConnection hsconn = new HsqlConnection(holdingConnection);
     LogFactory.getLogger().setLogLevel("severe");
     liquibase = new Liquibase(CHANGE_LOG, resourceAccessor, hsconn);
     liquibase.dropAll();
     liquibase.update(contexts);
     hsconn.close();
   } catch (Exception e) {
     LOG.error("Error during database initialization", e);
     throw new RuntimeException("Error during database initialization", e);
   }
 }
 public static void cleanDB() throws Exception {
   liquiBase = new Liquibase(changeLogFile, new ClassLoaderResourceAccessor(), jdbcConnection);
   liquiBase.dropAll();
 }