01: package liquibase.parser.filter;
02:
03: import liquibase.ChangeSet;
04: import liquibase.database.MySQLDatabase;
05: import static org.junit.Assert.*;
06: import org.junit.Test;
07:
08: public class DbmsChangeSetFilterTest {
09:
10: // @Test
11: // public void emptyDbms() {
12: // DbmsChangeSetFilter filter = new DbmsChangeSetFilter();
13: //
14: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql")));
15: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle")));
16: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle, mysql")));
17: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null)));
18: // }
19:
20: @Test
21: public void singleDbms() {
22: DbmsChangeSetFilter filter = new DbmsChangeSetFilter(
23: new MySQLDatabase());
24:
25: assertTrue(filter.accepts(new ChangeSet(null, null, false,
26: false, null, null, null, "mysql")));
27: assertTrue(filter.accepts(new ChangeSet(null, null, false,
28: false, null, null, null, "mysql, oracle")));
29: assertFalse(filter.accepts(new ChangeSet(null, null, false,
30: false, null, null, null, "oracle")));
31: assertTrue(filter.accepts(new ChangeSet(null, null, false,
32: false, null, null, null, null)));
33: }
34:
35: // @Test
36: // public void multiContexts() {
37: // DbmsChangeSetFilter filter = new DbmsChangeSetFilter("mysql", "oracle");
38: //
39: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql")));
40: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle")));
41: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle, mysql")));
42: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "db2, oracle")));
43: // assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null, null, "db2")));
44: // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null)));
45: // }
46:
47: }
|