Search in sources :

Example 31 with Contexts

use of liquibase.Contexts in project liquibase by liquibase.

the class ContextChangeSetFilterTest method visitorContextFilterUpperUpper.

@Test
public void visitorContextFilterUpperUpper() {
    ContextChangeSetFilter filter = new ContextChangeSetFilter(new Contexts("TEST1"));
    ChangeSet changeSet = new ChangeSet(null, null, false, false, null, null, null, null);
    changeSet.addSqlVisitor(new TestSqlVisitor("TEST1"));
    assertTrue(filter.accepts(changeSet).isAccepted());
    assertEquals(1, changeSet.getSqlVisitors().size());
}
Also used : Contexts(liquibase.Contexts) ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Example 32 with Contexts

use of liquibase.Contexts in project liquibase by liquibase.

the class LiquibaseChangeLogSyncToTagMojo method performLiquibaseTask.

@Override
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException {
    super.performLiquibaseTask(liquibase);
    liquibase.changeLogSync(toTag, new Contexts(contexts), new LabelExpression(labels));
}
Also used : LabelExpression(liquibase.LabelExpression) Contexts(liquibase.Contexts)

Aggregations

Contexts (liquibase.Contexts)32 Test (org.junit.Test)18 Liquibase (liquibase.Liquibase)16 ChangeSet (liquibase.changelog.ChangeSet)12 LabelExpression (liquibase.LabelExpression)10 LiquibaseException (liquibase.exception.LiquibaseException)8 IOException (java.io.IOException)5 Database (liquibase.database.Database)5 BuildException (org.apache.tools.ant.BuildException)5 FileResource (org.apache.tools.ant.types.resources.FileResource)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 RuntimeEnvironment (liquibase.RuntimeEnvironment)4 Writer (java.io.Writer)3 Connection (java.sql.Connection)3 ContextChangeSetFilter (liquibase.changelog.filter.ContextChangeSetFilter)3 JdbcConnection (liquibase.database.jvm.JdbcConnection)3 FileSystemResourceAccessor (liquibase.resource.FileSystemResourceAccessor)3 ResourceAccessor (liquibase.resource.ResourceAccessor)3 OutputStreamWriter (java.io.OutputStreamWriter)2 SQLException (java.sql.SQLException)2