1 package liquibase.changelog.filter; 2 3 import liquibase.changelog.ChangeSet; 4 import liquibase.database.core.MySQLDatabase; 5 import static org.junit.Assert.*; 6 import org.junit.Test; 7 8 public class DbmsChangeSetFilterTest { 9 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(new MySQLDatabase()); 23 24 assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null,null, "mysql"))); 25 assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null,null, "mysql, oracle"))); 26 assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null,null, "oracle"))); 27 assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null))); 28 } 29 30 // @Test 31 // public void multiContexts() { 32 // DbmsChangeSetFilter filter = new DbmsChangeSetFilter("mysql", "oracle"); 33 // 34 // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "mysql"))); 35 // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle"))); 36 // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "oracle, mysql"))); 37 // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, "db2, oracle"))); 38 // assertFalse(filter.accepts(new ChangeSet(null, null, false, false, null, null, "db2"))); 39 // assertTrue(filter.accepts(new ChangeSet(null, null, false, false, null, null, null))); 40 // } 41 42 }