-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metadata for flyway-core 10.15 (#519)
- Loading branch information
1 parent
736dbe6
commit d72c891
Showing
14 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"reflect-config.json", | ||
"resource-config.json" | ||
] |
72 changes: 72 additions & 0 deletions
72
metadata/org.flywaydb/flyway-core/10.15.0/reflect-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[ | ||
{ | ||
"name": "org.flywaydb.core.api.migration.baseline.BaselineMigrationConfigurationExtension", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister" | ||
}, | ||
"allPublicConstructors": true, | ||
"allPublicMethods": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.extensibility.ConfigurationExtension", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister" | ||
}, | ||
"allPublicMethods": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.extensibility.Plugin", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister" | ||
}, | ||
"allPublicMethods": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.internal.command.clean.CleanModeConfigurationExtension", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister" | ||
}, | ||
"allPublicConstructors": true, | ||
"allPublicMethods": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.internal.logging.slf4j.Slf4jLogCreator", | ||
"condition": { | ||
"typeReachable": "org.slf4j.Logger" | ||
}, | ||
"allPublicConstructors": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.internal.logging.log4j2.Log4j2LogCreator", | ||
"condition": { | ||
"typeReachable": "org.apache.logging.log4j.Logger" | ||
}, | ||
"allPublicConstructors": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.internal.logging.apachecommons.ApacheCommonsLogCreator", | ||
"condition": { | ||
"typeReachable": "org.apache.commons.logging.Log" | ||
}, | ||
"allPublicConstructors": true | ||
}, | ||
{ | ||
"name": "org.flywaydb.core.internal.publishing.PublishingConfigurationExtension", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister" | ||
}, | ||
"allPublicMethods": true | ||
}, | ||
{ | ||
"name": "sun.security.provider.SHA2$SHA256", | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.jdbc.JdbcUtils" | ||
}, | ||
"methods": [ | ||
{ | ||
"name": "<init>", | ||
"parameterTypes": [] | ||
} | ||
] | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
metadata/org.flywaydb/flyway-core/10.15.0/resource-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"bundles": [], | ||
"resources": { | ||
"includes": [ | ||
{ | ||
"condition": { | ||
"typeReachable": "org.flywaydb.core.internal.license.VersionPrinter" | ||
}, | ||
"pattern": "\\Qorg/flywaydb/core/internal/version.txt\\E" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
gradlew.bat | ||
gradlew | ||
gradle/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright and related rights waived via CC0 | ||
* | ||
* You should have received a copy of the CC0 legalcode along with this | ||
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
*/ | ||
plugins { | ||
id "org.graalvm.internal.tck" | ||
} | ||
|
||
String libraryVersion = tck.testedLibraryVersion.get() | ||
|
||
dependencies { | ||
testImplementation "org.flywaydb:flyway-core:$libraryVersion" | ||
testImplementation 'com.h2database:h2:2.1.210' | ||
testImplementation 'org.assertj:assertj-core:3.22.0' | ||
testImplementation 'org.awaitility:awaitility:4.2.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
library.version = 10.15.0 | ||
metadata.dir = org.flywaydb/flyway-core/10.15.0/ |
13 changes: 13 additions & 0 deletions
13
tests/src/org.flywaydb/flyway-core/10.15.0/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pluginManagement { | ||
def tckPath = Objects.requireNonNullElse( | ||
System.getenv("GVM_TCK_TCKDIR"), | ||
"../../../../tck-build-logic" | ||
) | ||
includeBuild(tckPath) | ||
} | ||
|
||
plugins { | ||
id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT" | ||
} | ||
|
||
rootProject.name = 'org.flywaydb.flyway-core_tests' |
47 changes: 47 additions & 0 deletions
47
...ydb/flyway-core/10.15.0/src/test/java/org_flywaydb/flyway_core/FixedResourceProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright and related rights waived via CC0 | ||
* | ||
* You should have received a copy of the CC0 legalcode along with this | ||
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
*/ | ||
package org_flywaydb.flyway_core; | ||
|
||
import org.flywaydb.core.api.ResourceProvider; | ||
import org.flywaydb.core.api.resource.LoadableResource; | ||
import org.flywaydb.core.internal.resource.classpath.ClassPathResource; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* This is needed as GraalVM doesn't support enumerating resources. It uses a hardcoded list of migrations. | ||
*/ | ||
class FixedResourceProvider implements ResourceProvider { | ||
private static final Set<String> MIGRATIONS; | ||
|
||
static { | ||
Set<String> migrations = new HashSet<>(); | ||
migrations.add("db/migration/V1__create_table.sql"); | ||
migrations.add("db/migration/V2__alter_table.sql"); | ||
MIGRATIONS = Collections.unmodifiableSet(migrations); | ||
} | ||
|
||
@Override | ||
public LoadableResource getResource(String name) { | ||
if (!MIGRATIONS.contains(name)) { | ||
return null; | ||
} | ||
return new ClassPathResource(null, name, getClass().getClassLoader(), StandardCharsets.UTF_8); | ||
} | ||
|
||
@Override | ||
public Collection<LoadableResource> getResources(String prefix, String[] suffixes) { | ||
return MIGRATIONS.stream() | ||
.map(file -> new ClassPathResource(null, file, getClass().getClassLoader(), StandardCharsets.UTF_8)) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
....flywaydb/flyway-core/10.15.0/src/test/java/org_flywaydb/flyway_core/Flyway_coreTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright and related rights waived via CC0 | ||
* | ||
* You should have received a copy of the CC0 legalcode along with this | ||
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
*/ | ||
package org_flywaydb.flyway_core; | ||
|
||
import org.flywaydb.core.Flyway; | ||
import org.flywaydb.core.api.configuration.Configuration; | ||
import org.flywaydb.core.api.configuration.FluentConfiguration; | ||
import org.flywaydb.core.api.output.MigrateResult; | ||
import org.h2.jdbcx.JdbcDataSource; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.sql.DataSource; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class Flyway_coreTest { | ||
|
||
@Test | ||
void migrate() { | ||
DataSource dataSource = getDataSource(); | ||
|
||
Configuration configuration = new FluentConfiguration() | ||
.dataSource(dataSource) | ||
.encoding(StandardCharsets.UTF_8) | ||
.resourceProvider(new FixedResourceProvider()); | ||
|
||
Flyway flyway = new Flyway(configuration); | ||
MigrateResult migration = flyway.migrate(); | ||
|
||
assertThat(migration.success).isTrue(); | ||
assertThat(migration.migrationsExecuted).isEqualTo(2); | ||
} | ||
|
||
private DataSource getDataSource() { | ||
JdbcDataSource dataSource = new JdbcDataSource(); | ||
dataSource.setUrl("jdbc:h2:mem:test"); | ||
dataSource.setUser("user"); | ||
dataSource.setPassword("password"); | ||
return dataSource; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...db/flyway-core/10.15.0/src/test/resources/META-INF/native-image/test/resource-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"bundles": [], | ||
"resources": { | ||
"includes": [ | ||
{ | ||
"pattern": "\\Qdb/migration/V1__create_table.sql\\E" | ||
}, | ||
{ | ||
"pattern": "\\Qdb/migration/V2__alter_table.sql\\E" | ||
} | ||
] | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...src/org.flywaydb/flyway-core/10.15.0/src/test/resources/db/migration/V1__create_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE test | ||
( | ||
id INT PRIMARY KEY, | ||
title VARCHAR NOT NULL | ||
); |
2 changes: 2 additions & 0 deletions
2
.../src/org.flywaydb/flyway-core/10.15.0/src/test/resources/db/migration/V2__alter_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE test | ||
ADD COLUMN name INT NOT NULL DEFAULT 1; |