use of org.flywaydb.core.internal.util.Location in project flyway by flyway.
the class ClassPathScannerSmallTest method scanForClasses.
@Test
public void scanForClasses() throws Exception {
Class<?>[] classes = classPathScanner.scanForClasses(new Location("classpath:org/flywaydb/core/internal/resolver/jdbc/dummy"), JdbcMigration.class);
assertEquals(3, classes.length);
assertEquals(V2__InterfaceBasedMigration.class, classes[0]);
assertEquals(Version3dot5.class, classes[2]);
assertEquals(V4__DummyExtendedAbstractJdbcMigration.class, classes[1]);
}
use of org.flywaydb.core.internal.util.Location in project flyway by flyway.
the class ClassPathScannerSmallTest method scanForResourcesDefaultPackage.
@Test
public void scanForResourcesDefaultPackage() throws Exception {
Resource[] resources = classPathScanner.scanForResources(new Location("classpath:"), "logback", "");
assertEquals(1, resources.length);
assertEquals("logback.xml", resources[0].getLocation());
}
use of org.flywaydb.core.internal.util.Location in project flyway by flyway.
the class ClassPathScannerSmallTest method scanForClassesSubPackage.
@Test
public void scanForClassesSubPackage() throws Exception {
Class<?>[] classes = classPathScanner.scanForClasses(new Location("classpath:org/flywaydb/core/internal/dbsupport"), MigrationTestCase.class);
assertTrue(classes.length >= 10);
assertEquals(DB2MigrationMediumTest.class, classes[0]);
}
use of org.flywaydb.core.internal.util.Location 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