Search in sources :

Example 6 with RuntimeEnvironment

use of liquibase.RuntimeEnvironment in project liquibase by liquibase.

the class ChangeLogIteratorTest method runChangeSet_doubleFilterIterator.

@Test
public void runChangeSet_doubleFilterIterator() throws Exception {
    TestChangeSetVisitor testChangeLogVisitor = new TestChangeSetVisitor();
    ChangeLogIterator iterator = new ChangeLogIterator(changeLog, new ContextChangeSetFilter(new Contexts("test1")), new DbmsChangeSetFilter(new MySQLDatabase()));
    iterator.run(testChangeLogVisitor, new RuntimeEnvironment(null, null, null));
    assertEquals(3, testChangeLogVisitor.visitedChangeSets.size());
    assertEquals("1", testChangeLogVisitor.visitedChangeSets.get(0).getId());
    assertEquals("4", testChangeLogVisitor.visitedChangeSets.get(1).getId());
    assertEquals("5", testChangeLogVisitor.visitedChangeSets.get(2).getId());
}
Also used : RuntimeEnvironment(liquibase.RuntimeEnvironment) ContextChangeSetFilter(liquibase.changelog.filter.ContextChangeSetFilter) MySQLDatabase(liquibase.database.core.MySQLDatabase) DbmsChangeSetFilter(liquibase.changelog.filter.DbmsChangeSetFilter) Contexts(liquibase.Contexts) Test(org.junit.Test)

Aggregations

RuntimeEnvironment (liquibase.RuntimeEnvironment)6 Test (org.junit.Test)5 Contexts (liquibase.Contexts)4 ContextChangeSetFilter (liquibase.changelog.filter.ContextChangeSetFilter)4 DbmsChangeSetFilter (liquibase.changelog.filter.DbmsChangeSetFilter)3 MySQLDatabase (liquibase.database.core.MySQLDatabase)2 ArrayList (java.util.ArrayList)1 LabelExpression (liquibase.LabelExpression)1 ChangeLogIterator (liquibase.changelog.ChangeLogIterator)1 ChangeLogParameters (liquibase.changelog.ChangeLogParameters)1 ChangeSet (liquibase.changelog.ChangeSet)1 DatabaseChangeLog (liquibase.changelog.DatabaseChangeLog)1 ChangeSetFilterResult (liquibase.changelog.filter.ChangeSetFilterResult)1 LabelChangeSetFilter (liquibase.changelog.filter.LabelChangeSetFilter)1 ChangeSetVisitor (liquibase.changelog.visitor.ChangeSetVisitor)1 ValidatingVisitor (liquibase.changelog.visitor.ValidatingVisitor)1 Database (liquibase.database.Database)1 LiquibaseException (liquibase.exception.LiquibaseException)1 ValidationFailedException (liquibase.exception.ValidationFailedException)1 MockDatabase (liquibase.sdk.database.MockDatabase)1