Search in sources :

Example 56 with Liquibase

use of liquibase.Liquibase in project liquibase by liquibase.

the class AbstractIntegrationTest method invalidIncludeDoesntBreakLiquibase.

@Test
public void invalidIncludeDoesntBreakLiquibase() throws Exception {
    if (database == null) {
        return;
    }
    Liquibase liquibase = createLiquibase(invalidReferenceChangeLog);
    try {
        liquibase.update(new Contexts());
        fail("Did not fail with invalid include");
    } catch (ChangeLogParseException ignored) {
    //expected
    }
    LockService lockService = LockServiceFactory.getInstance().getLockService(database);
    assertFalse(lockService.hasChangeLogLock());
}
Also used : Liquibase(liquibase.Liquibase) LockService(liquibase.lockservice.LockService) ChangeLogParseException(liquibase.exception.ChangeLogParseException) Contexts(liquibase.Contexts) Test(org.junit.Test)

Example 57 with Liquibase

use of liquibase.Liquibase in project liquibase by liquibase.

the class AbstractIntegrationTest method testTag.

@Test
public void testTag() throws Exception {
    if (database == null) {
        return;
    }
    Liquibase liquibase = createLiquibase(completeChangeLog);
    clearDatabase(liquibase);
    liquibase = createLiquibase(completeChangeLog);
    liquibase.update(this.contexts);
    liquibase.tag("Test Tag");
}
Also used : Liquibase(liquibase.Liquibase) Test(org.junit.Test)

Example 58 with Liquibase

use of liquibase.Liquibase in project liquibase by liquibase.

the class AbstractIntegrationTest method testUnrunChangeSetsEmptyDatabase.

@Test
public void testUnrunChangeSetsEmptyDatabase() throws Exception {
    if (database == null) {
        return;
    }
    Liquibase liquibase = createLiquibase(completeChangeLog);
    clearDatabase(liquibase);
    liquibase = createLiquibase(completeChangeLog);
    List<ChangeSet> list = liquibase.listUnrunChangeSets(new Contexts(this.contexts), new LabelExpression());
    assertTrue(list.size() > 0);
}
Also used : Liquibase(liquibase.Liquibase) LabelExpression(liquibase.LabelExpression) Contexts(liquibase.Contexts) ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Aggregations

Liquibase (liquibase.Liquibase)58 Test (org.junit.Test)37 Contexts (liquibase.Contexts)11 LiquibaseException (liquibase.exception.LiquibaseException)10 ValidationFailedException (liquibase.exception.ValidationFailedException)9 BuildException (org.apache.tools.ant.BuildException)9 IOException (java.io.IOException)8 DatabaseSnapshot (liquibase.snapshot.DatabaseSnapshot)7 SnapshotControl (liquibase.snapshot.SnapshotControl)7 CatalogAndSchema (liquibase.CatalogAndSchema)6 LabelExpression (liquibase.LabelExpression)6 Database (liquibase.database.Database)6 AbstractIntegrationTest (liquibase.dbtest.AbstractIntegrationTest)6 Namespace (net.sourceforge.argparse4j.inf.Namespace)6 Date (java.util.Date)5 JdbcConnection (liquibase.database.jvm.JdbcConnection)5 CompareControl (liquibase.diff.compare.CompareControl)5 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)5 FileResource (org.apache.tools.ant.types.resources.FileResource)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4