Package ch.inftec.flyway.core

Source Code of ch.inftec.flyway.core.AbstractRepeatableFlywayTest

package ch.inftec.flyway.core;

import org.flywaydb.core.Flyway;
import org.flywaydb.core.internal.dbsupport.DbSupport;
import org.flywaydb.core.internal.dbsupport.DbSupportFactory;
import org.junit.Before;

import java.util.Properties;

/**
* Created by rotscher on 5/20/14.
*/
public class AbstractRepeatableFlywayTest {

    protected final Flyway flyway = new Flyway();
    private RepeatableFlyway repeatableFlyway;

    @Before
    public void setUp() throws Exception {

        Properties properties = new Properties();
        properties.load(RepeatableFlyway.class.getResourceAsStream("mysql.properties"));
        flyway.configure(properties);

        RepeatableFlyway.configure(flyway, properties);
        DbSupport dbSupport = DbSupportFactory.createDbSupport(flyway.getDataSource().getConnection(), false);
        dbSupport.getCurrentSchema().drop();
        dbSupport.getCurrentSchema().create();
        flyway.init();
    }
}
TOP

Related Classes of ch.inftec.flyway.core.AbstractRepeatableFlywayTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.