Search in sources :

Example 16 with Resource

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

the class ClassPathScannerSmallTest method scanForResourcesSplitDirectory.

@Test
public void scanForResourcesSplitDirectory() throws Exception {
    Resource[] resources = classPathScanner.scanForResources(new Location("classpath:org/flywaydb/core/internal/dbsupport"), "create", ".sql");
    assertTrue(resources.length > 7);
    assertEquals("org/flywaydb/core/internal/dbsupport/db2/createMetaDataTable.sql", resources[0].getLocation());
}
Also used : Resource(org.flywaydb.core.internal.util.scanner.Resource) Location(org.flywaydb.core.internal.util.Location) Test(org.junit.Test) DB2MigrationMediumTest(org.flywaydb.core.internal.dbsupport.db2.DB2MigrationMediumTest)

Example 17 with Resource

use of org.flywaydb.core.internal.util.scanner.Resource 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());
}
Also used : Resource(org.flywaydb.core.internal.util.scanner.Resource) Location(org.flywaydb.core.internal.util.Location) Test(org.junit.Test) DB2MigrationMediumTest(org.flywaydb.core.internal.dbsupport.db2.DB2MigrationMediumTest)

Aggregations

Resource (org.flywaydb.core.internal.util.scanner.Resource)17 Location (org.flywaydb.core.internal.util.Location)11 Test (org.junit.Test)11 DB2MigrationMediumTest (org.flywaydb.core.internal.dbsupport.db2.DB2MigrationMediumTest)7 ClassPathResource (org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource)4 ClassPathScanner (org.flywaydb.core.internal.util.scanner.classpath.ClassPathScanner)4 FileSystemResource (org.flywaydb.core.internal.util.scanner.filesystem.FileSystemResource)3 Test (org.testng.annotations.Test)3 File (java.io.File)2 HashSet (java.util.HashSet)2 MigrationVersion (org.flywaydb.core.api.MigrationVersion)2 ResolvedMigrationImpl (org.flywaydb.core.internal.resolver.ResolvedMigrationImpl)2 AfterClass (org.junit.AfterClass)2 BeforeClass (org.junit.BeforeClass)2 Hashing (com.google.common.hash.Hashing)1 ByteSource (com.google.common.io.ByteSource)1 IOException (java.io.IOException)1 String.format (java.lang.String.format)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1