use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class CountChangeSetFilterTest method acceptsOneCorrectly.
@Test
public void acceptsOneCorrectly() {
CountChangeSetFilter filter = new CountChangeSetFilter(1);
assertTrue(filter.accepts(new ChangeSet("a1", "b1", false, false, "c1", null, null, null)).isAccepted());
assertFalse(filter.accepts(new ChangeSet("a2", "b2", false, false, "c2", null, null, null)).isAccepted());
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class CountChangeSetFilterTest method acceptsZeroCorrectly.
@Test
public void acceptsZeroCorrectly() {
CountChangeSetFilter filter = new CountChangeSetFilter(0);
assertFalse(filter.accepts(new ChangeSet("a1", "b1", false, false, "c1", null, null, null)).isAccepted());
assertFalse(filter.accepts(new ChangeSet("a2", "b2", false, false, "c2", null, null, null)).isAccepted());
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ExecutedAfterChangeSetFilterTest method accepts_noRan.
@Test
public void accepts_noRan() throws Exception {
ExecutedAfterChangeSetFilter filter = new ExecutedAfterChangeSetFilter(new Date(), new ArrayList<RanChangeSet>());
assertFalse(filter.accepts(new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null)).isAccepted());
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ExecutedAfterChangeSetFilterTest method accepts_nullDate.
@Test
public void accepts_nullDate() throws Exception {
ArrayList<RanChangeSet> ranChanges = new ArrayList<RanChangeSet>();
ranChanges.add(new RanChangeSet("path/changelog", "1", "testAuthor", CheckSum.parse("12345"), new Date(), null, null, null, null, null, null, null));
ranChanges.add(new RanChangeSet("path/changelog", "2", "testAuthor", CheckSum.parse("12345"), null, null, null, null, null, null, null, null));
ranChanges.add(new RanChangeSet("path/changelog", "3", "testAuthor", CheckSum.parse("12345"), new Date(), null, null, null, null, null, null, null));
ExecutedAfterChangeSetFilter filter = new ExecutedAfterChangeSetFilter(new Date(), ranChanges);
assertFalse(filter.accepts(new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null)).isAccepted());
}
use of liquibase.changelog.ChangeSet in project liquibase by liquibase.
the class ExecutedAfterChangeSetFilterTest method accepts.
@Test
public void accepts() throws Exception {
ArrayList<RanChangeSet> ranChanges = new ArrayList<RanChangeSet>();
ranChanges.add(new RanChangeSet("path/changelog", "1", "testAuthor", CheckSum.parse("12345"), new Date(new Date().getTime() - (10 * 1000 * 60 * 60)), null, null, null, null, null, null, null));
ranChanges.add(new RanChangeSet("path/changelog", "2", "testAuthor", CheckSum.parse("12345"), new Date(new Date().getTime() - (8 * 1000 * 60 * 60)), null, null, null, null, null, null, null));
ranChanges.add(new RanChangeSet("path/changelog", "3", "testAuthor", CheckSum.parse("12345"), new Date(new Date().getTime() - (4 * 1000 * 60 * 60)), null, null, null, null, null, null, null));
ExecutedAfterChangeSetFilter filter = new ExecutedAfterChangeSetFilter(new Date(new Date().getTime() - (6 * 1000 * 60 * 60)), ranChanges);
assertFalse(filter.accepts(new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null)).isAccepted());
assertFalse(filter.accepts(new ChangeSet("2", "testAuthor", false, false, "path/changelog", null, null, null)).isAccepted());
assertTrue(filter.accepts(new ChangeSet("3", "testAuthor", false, false, "path/changelog", null, null, null)).isAccepted());
}
Aggregations