Search in sources :

Example 1 with StringLogCreator

use of org.flywaydb.core.internal.util.logging.StringLogCreator in project flyway by flyway.

the class FlywayMediumTest method failed.

@Test
public void failed() {
    StringLogCreator logCreator = new StringLogCreator();
    LogFactory.setLogCreator(logCreator);
    try {
        Flyway flyway = new Flyway();
        flyway.setDataSource("jdbc:h2:mem:flyway_failed;DB_CLOSE_DELAY=-1", "sa", "");
        flyway.setLocations("migration/failed");
        flyway.migrate();
        fail();
    } catch (FlywayException e) {
        System.out.println(logCreator.getOutput());
    } finally {
        LogFactory.setLogCreator(null);
    }
}
Also used : FlywayException(org.flywaydb.core.api.FlywayException) StringLogCreator(org.flywaydb.core.internal.util.logging.StringLogCreator) Test(org.junit.Test)

Aggregations

FlywayException (org.flywaydb.core.api.FlywayException)1 StringLogCreator (org.flywaydb.core.internal.util.logging.StringLogCreator)1 Test (org.junit.Test)1