use of liquibase.Liquibase in project liquibase by liquibase.
the class SpringLiquibase method createLiquibase.
protected Liquibase createLiquibase(Connection c) throws LiquibaseException {
SpringResourceOpener resourceAccessor = createResourceOpener();
Liquibase liquibase = new Liquibase(getChangeLog(), resourceAccessor, createDatabase(c, resourceAccessor));
liquibase.setIgnoreClasspathPrefix(isIgnoreClasspathPrefix());
if (parameters != null) {
for (Map.Entry<String, String> entry : parameters.entrySet()) {
liquibase.setChangeLogParameter(entry.getKey(), entry.getValue());
}
}
if (isDropFirst()) {
liquibase.dropAll();
}
return liquibase;
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method testClearChecksums.
@Test
public void testClearChecksums() throws Exception {
if (database == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
liquibase.update(this.contexts);
liquibase.clearCheckSums();
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method testTagEmptyDatabase.
@Test
public void testTagEmptyDatabase() throws Exception {
if (database == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
liquibase.checkLiquibaseTables(false, null, new Contexts(), new LabelExpression());
liquibase.tag("empty");
liquibase = createLiquibase(rollbackChangeLog);
liquibase.update(new Contexts());
liquibase.rollback("empty", new Contexts());
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method testUpdateClearUpdate.
@Test
public void testUpdateClearUpdate() throws Exception {
if (database == null) {
return;
}
Liquibase liquibase = createLiquibase(completeChangeLog);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
liquibase.update(this.contexts);
clearDatabase(liquibase);
liquibase = createLiquibase(completeChangeLog);
liquibase.update(this.contexts);
}
use of liquibase.Liquibase in project liquibase by liquibase.
the class AbstractIntegrationTest method runChangeLogFile.
protected void runChangeLogFile(String changeLogFile) throws Exception {
Liquibase liquibase = createLiquibase(changeLogFile);
clearDatabase(liquibase);
//run again to test changelog testing logic
liquibase = createLiquibase(changeLogFile);
try {
liquibase.update(this.contexts);
} catch (ValidationFailedException e) {
e.printDescriptiveError(System.out);
throw e;
}
}
Aggregations