Search in sources :

Example 1 with LocalRdbmsServiceTestConfig

use of com.google.appengine.tools.development.testing.LocalRdbmsServiceTestConfig in project flyway by flyway.

the class GoogleCloudSQLMigrationMediumTest method createDataSource.

@Override
protected DataSource createDataSource(Properties customProperties) throws Exception {
    String user = customProperties.getProperty("mysql.user", "flyway");
    String password = customProperties.getProperty("mysql.password", "flyway");
    String url = customProperties.getProperty("mysql.cloudsql_url", "jdbc:mysql://localhost:3306/flyway_cloudsql_db");
    LocalRdbmsServiceTestConfig config = new LocalRdbmsServiceTestConfig();
    config.setServerType(LocalRdbmsService.ServerType.LOCAL);
    ClassUtils.instantiate("com.mysql.jdbc.Driver", Thread.currentThread().getContextClassLoader());
    config.setDriverClass("com.mysql.jdbc.Driver");
    config.setJdbcConnectionStringFormat(url);
    config.setUser(user);
    config.setPassword(password);
    helper = new LocalServiceTestHelper(config);
    helper.setUp();
    return new DriverDataSource(Thread.currentThread().getContextClassLoader(), null, "jdbc:google:rdbms://localhost/flyway_cloudsql_db", "", "", null);
}
Also used : LocalRdbmsServiceTestConfig(com.google.appengine.tools.development.testing.LocalRdbmsServiceTestConfig) DriverDataSource(org.flywaydb.core.internal.util.jdbc.DriverDataSource) LocalServiceTestHelper(com.google.appengine.tools.development.testing.LocalServiceTestHelper)

Aggregations

LocalRdbmsServiceTestConfig (com.google.appengine.tools.development.testing.LocalRdbmsServiceTestConfig)1 LocalServiceTestHelper (com.google.appengine.tools.development.testing.LocalServiceTestHelper)1 DriverDataSource (org.flywaydb.core.internal.util.jdbc.DriverDataSource)1