use of org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver in project flyway by flyway.
the class MigrationTestCase method assertChecksum.
/**
* Compares the DB checksum to the classpath checksum of this migration.
*
* @param migrationInfo
* The migration to check.
*/
protected void assertChecksum(MigrationInfo migrationInfo) {
SqlMigrationResolver sqlMigrationResolver = new SqlMigrationResolver(dbSupport, new Scanner(Thread.currentThread().getContextClassLoader()), new Location(getBasedir()), 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());
}
}
}
use of org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver 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());
}
}
}
Aggregations