use of liquibase.Contexts in project liquibase by liquibase.
the class ChangeLogParametersTest method setParameterValue_rightDBWrongContext.
@Test
public void setParameterValue_rightDBWrongContext() {
ChangeLogParameters changeLogParameters = new ChangeLogParameters(new H2Database());
changeLogParameters.setContexts(new Contexts("junit"));
changeLogParameters.set("doubleSet", "originalValue", "anotherContext", "anotherLabel", "baddb, h2", true, null);
assertNull(changeLogParameters.getValue("doubleSet", null));
}
use of liquibase.Contexts in project liquibase by liquibase.
the class ContextChangeSetFilterTest method visitorContextFilterLowerLower.
@Test
public void visitorContextFilterLowerLower() {
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());
}
use of liquibase.Contexts in project liquibase by liquibase.
the class ContextChangeSetFilterTest method visitorContextFilterLowerUpper.
@Test
public void visitorContextFilterLowerUpper() {
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());
}
use of liquibase.Contexts in project liquibase by liquibase.
the class ContextChangeSetFilterTest method visitorContextFilterUpperLower.
@Test
public void visitorContextFilterUpperLower() {
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());
}
use of liquibase.Contexts in project liquibase by liquibase.
the class ContextChangeSetFilterTest method multiContexts.
@Test
public void multiContexts() {
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());
}
Aggregations