use of org.flywaydb.core.Flyway in project flyway by flyway.
the class MySQLMigrationMediumTest method migrateWithNonExistingSchemaSetInPropertyButNotInUrl.
@Test
public void migrateWithNonExistingSchemaSetInPropertyButNotInUrl() throws Exception {
Flyway flyway = new Flyway();
flyway.setDataSource("jdbc:mysql://localhost/flyway_db", "flyway", "flyway");
flyway.setSchemas("non-existing-schema");
flyway.setLocations(BASEDIR);
flyway.clean();
assertEquals(4, flyway.migrate());
}
use of org.flywaydb.core.Flyway in project flyway by flyway.
the class MySQLMigrationMediumTest method migrateWithExistingSchemaSetInPropertyButNotInUrl.
@Test
public void migrateWithExistingSchemaSetInPropertyButNotInUrl() throws Exception {
Flyway flyway = new Flyway();
flyway.setDataSource("jdbc:mysql://localhost/flyway_db", "flyway", "flyway");
flyway.setSchemas("flyway_db");
flyway.setLocations(getBasedir());
flyway.clean();
assertEquals(4, flyway.migrate());
}
use of org.flywaydb.core.Flyway in project flyway by flyway.
the class SQLiteMigrationMediumTest method singleConnectionExternalDataSource.
@Test
public void singleConnectionExternalDataSource() {
SQLiteConfig config = new SQLiteConfig();
config.setJournalMode(SQLiteConfig.JournalMode.WAL);
config.setSynchronous(SQLiteConfig.SynchronousMode.NORMAL);
SQLiteDataSource dataSource = new SQLiteDataSource(config);
dataSource.setUrl("jdbc:sqlite:target/single_external");
Flyway flyway = new Flyway();
flyway.setDataSource(dataSource);
flyway.setLocations("migration/sql");
flyway.clean();
flyway.migrate();
}
use of org.flywaydb.core.Flyway in project flyway by flyway.
the class SQLServerCaseSensitiveMigrationTestCase method caseSensitiveCollation.
@Test
public void caseSensitiveCollation() throws Exception {
File customPropertiesFile = new File(System.getProperty("user.home") + "/flyway-mediumtests.properties");
Properties customProperties = new Properties();
if (customPropertiesFile.canRead()) {
customProperties.load(new FileInputStream(customPropertiesFile));
}
DataSource dataSource = createDataSource(customProperties);
Flyway flyway = new Flyway();
flyway.setDataSource(dataSource);
flyway.setLocations("migration/sql");
flyway.clean();
flyway.migrate();
assertEquals("2.0", flyway.info().current().getVersion().toString());
assertEquals(0, flyway.migrate());
assertEquals(4, flyway.info().applied().length);
Connection connection = dataSource.getConnection();
DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, true);
assertEquals(2, dbSupport.getJdbcTemplate().queryForInt("select count(*) from all_misters"));
connection.close();
}
use of org.flywaydb.core.Flyway in project flyway by flyway.
the class EnterpriseDBSuperUserMigrationMediumTest method setUp.
@Before
public void setUp() throws Exception {
File customPropertiesFile = new File(System.getProperty("user.home") + "/flyway-mediumtests.properties");
Properties customProperties = new Properties();
if (customPropertiesFile.canRead()) {
customProperties.load(new FileInputStream(customPropertiesFile));
}
String password = customProperties.getProperty("enterprisedb.password", "flyway");
String url = customProperties.getProperty("enterprisedb.url", "jdbc:edb://localhost/flyway_db");
flyway = new Flyway();
flyway.setSchemas("super_user_test");
flyway.setDataSource(new DriverDataSource(Thread.currentThread().getContextClassLoader(), null, url, "flyway", password, new Properties()));
flyway.setValidateOnMigrate(true);
flyway.clean();
}
Aggregations