use of com.alessiodp.core.common.storage.dispatchers.SQLDispatcher in project ADP-Core by AlessioDP.
the class MigratorTest method prepareMigrator.
private Migrator prepareMigrator(ConnectionFactory cf, StorageType storageType) {
if (cf == null)
return null;
TreeSet<String> scripts = new TreeSet<>();
switch(storageType) {
case MARIADB:
case MYSQL:
case POSTGRESQL:
case SQLITE:
case H2:
scripts.add("1__Test_queries.sql");
scripts.add("2__Second_test.sql");
break;
default:
return null;
}
return Migrator.configure().setLocation("db/migrations/" + CommonUtils.toLowerCase(storageType.name()) + "/").setScripts(scripts).setConnectionFactory(cf).setStorageType(storageType).load(mockPlugin, new SQLDispatcher(mockPlugin, storageType) {
@Override
protected ConnectionFactory initConnectionFactory() {
return null;
}
});
}
Aggregations