Search in sources :

Example 6 with Scanner

use of org.flywaydb.core.internal.util.scanner.Scanner in project flyway by flyway.

the class DB2zOSMigrationMediumTest method assertChecksum.

@Override
protected void assertChecksum(MigrationInfo migrationInfo) {
    SqlMigrationResolver sqlMigrationResolver = new SqlMigrationResolver(dbSupport, new Scanner(Thread.currentThread().getContextClassLoader()), new Location(getBasedir() + "/default"), PlaceholderReplacer.NO_PLACEHOLDERS, FlywayConfigurationForTests.create());
    List<ResolvedMigration> migrations = sqlMigrationResolver.resolveMigrations();
    for (ResolvedMigration migration : migrations) {
        if (migration.getVersion().toString().equals(migrationInfo.getVersion().toString())) {
            assertEquals("Wrong checksum for " + migrationInfo.getScript(), migration.getChecksum(), migrationInfo.getChecksum());
        }
    }
}
Also used : Scanner(org.flywaydb.core.internal.util.scanner.Scanner) SqlMigrationResolver(org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver) ResolvedMigration(org.flywaydb.core.api.resolver.ResolvedMigration) Location(org.flywaydb.core.internal.util.Location)

Aggregations

Scanner (org.flywaydb.core.internal.util.scanner.Scanner)6 ResolvedMigration (org.flywaydb.core.api.resolver.ResolvedMigration)5 MigrationResolver (org.flywaydb.core.api.resolver.MigrationResolver)3 Location (org.flywaydb.core.internal.util.Location)3 Test (org.junit.Test)3 SqlMigrationResolver (org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver)2 Locations (org.flywaydb.core.internal.util.Locations)2 File (java.io.File)1 Connection (java.sql.Connection)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 FlywayException (org.flywaydb.core.api.FlywayException)1 FlywayCallback (org.flywaydb.core.api.callback.FlywayCallback)1 SqlScriptFlywayCallback (org.flywaydb.core.internal.callback.SqlScriptFlywayCallback)1 DbRepair (org.flywaydb.core.internal.command.DbRepair)1 DbSupport (org.flywaydb.core.internal.dbsupport.DbSupport)1 Schema (org.flywaydb.core.internal.dbsupport.Schema)1 MetaDataTable (org.flywaydb.core.internal.metadatatable.MetaDataTable)1 MetaDataTableImpl (org.flywaydb.core.internal.metadatatable.MetaDataTableImpl)1 CompositeMigrationResolver (org.flywaydb.core.internal.resolver.CompositeMigrationResolver)1