Search in sources :

Example 61 with ChangeSet

use of liquibase.changelog.ChangeSet in project liquibase by liquibase.

the class ContextChangeSetFilterTest method nullContexts.

@Test
public void nullContexts() {
    ContextChangeSetFilter filter = new ContextChangeSetFilter();
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1, test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null, null)).isAccepted());
}
Also used : ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Example 62 with ChangeSet

use of liquibase.changelog.ChangeSet in project liquibase by liquibase.

the class ContextChangeSetFilterTest method reallyNullContexts.

@Test
public void reallyNullContexts() {
    ContextChangeSetFilter filter = new ContextChangeSetFilter(null);
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1, test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null, null)).isAccepted());
}
Also used : ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Example 63 with ChangeSet

use of liquibase.changelog.ChangeSet in project liquibase by liquibase.

the class ContextChangeSetFilterTest method multiContextsSingeParameter.

@Test
public void multiContextsSingeParameter() {
    ContextChangeSetFilter filter = new ContextChangeSetFilter(new Contexts("test1, test2"));
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1, test2", null, null)).isAccepted());
    assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null, "test3", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test3, test1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test3, TEST1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null, null)).isAccepted());
}
Also used : Contexts(liquibase.Contexts) ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Example 64 with ChangeSet

use of liquibase.changelog.ChangeSet 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 65 with ChangeSet

use of liquibase.changelog.ChangeSet in project liquibase by liquibase.

the class ContextChangeSetFilterTest method emptyContexts.

@Test
public void emptyContexts() {
    ContextChangeSetFilter filter = new ContextChangeSetFilter();
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, "test1, test2", null, null)).isAccepted());
    assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null, null)).isAccepted());
}
Also used : ChangeSet(liquibase.changelog.ChangeSet) Test(org.junit.Test)

Aggregations

ChangeSet (liquibase.changelog.ChangeSet)75 Test (org.junit.Test)41 RanChangeSet (liquibase.changelog.RanChangeSet)13 Contexts (liquibase.Contexts)12 DatabaseChangeLog (liquibase.changelog.DatabaseChangeLog)11 Database (liquibase.database.Database)11 ArrayList (java.util.ArrayList)10 Liquibase (liquibase.Liquibase)10 Change (liquibase.change.Change)9 LiquibaseException (liquibase.exception.LiquibaseException)9 DiffOutputControl (liquibase.diff.output.DiffOutputControl)7 DiffToChangeLog (liquibase.diff.output.changelog.DiffToChangeLog)7 IOException (java.io.IOException)6 ObjectQuotingStrategy (liquibase.database.ObjectQuotingStrategy)6 DiffResult (liquibase.diff.DiffResult)6 CompareControl (liquibase.diff.compare.CompareControl)6 LabelExpression (liquibase.LabelExpression)5 Sql (liquibase.sql.Sql)5 SqlStatement (liquibase.statement.SqlStatement)5 MarkChangeSetRanStatement (liquibase.statement.core.MarkChangeSetRanStatement)5