use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ValidatingVisitorPreConditionsTest method setUp.
/**
* Create a DatabaseChangelog, one changeset, and a create sequence change
*/
@Before
public void setUp() {
changeLog = new DatabaseChangeLog();
changeSet1 = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null);
changeLog.addChangeSet(changeSet1);
CreateTableChange change1 = new CreateTableChange();
change1.setTableName("valid_test");
change1.addColumn(new ColumnConfig().setName("id").setType("int"));
changeSet1.addChange(change1);
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class DbmsChangeSetFilterTest method singleDbms.
// @Test
// public void emptyDbms() {
// DbmsChangeSetFilter filter = new DbmsChangeSetFilter();
//
// assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql")));
// assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle")));
// assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle, mysql")));
// assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null)));
// }
@Test
public void singleDbms() {
DbmsChangeSetFilter filter = new DbmsChangeSetFilter(new MySQLDatabase());
assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql", null)).isAccepted());
assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql, oracle", null)).isAccepted());
assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle", null)).isAccepted());
assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null, null)).isAccepted());
assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null, null, "h2,!mysql", null)).isAccepted());
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ChangeLogSyncVisitorTest method setUp.
@Before
public void setUp() {
changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null);
databaseChangeLog = new DatabaseChangeLog();
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ContextChangeSetFilterTest method nullListContexts.
@Test
public void nullListContexts() {
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());
}
use of liquibase.changelog.ChangeSet 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());
}
Aggregations