Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n0tl3ss committed Apr 10, 2024
1 parent e4933e1 commit 64fefce
Showing 1 changed file with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractGraalVMMavenFun
// withDebug()
withSample("java-application-with-resources")

List<String> options = []
List<String> options = ['-Dresources.autodetection.ignoreExistingResourcesConfig=true']
if (detection) {
options << '-Dresources.autodetection.enabled=true'
}
Expand All @@ -78,9 +78,6 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractGraalVMMavenFun
if (!restrictToModules) {
options << '-Dresources.autodetection.restrictToModuleDependencies=false'
}
if (ignoreExistingResourcesConfig) {
options << '-Dresources.autodetection.ignoreExistingResourcesConfig=true'
}
if (detectionExclusionPatterns) {
options << "-Dresources.autodetection.detectionExclusionPatterns=${joinForCliArg(detectionExclusionPatterns)}".toString()
}
Expand All @@ -92,8 +89,7 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractGraalVMMavenFun
buildSucceeded

and:
if (ignoreExistingResourcesConfig) {
matches(file("target/native/generated/generateTestResourceConfig/resource-config.json").text, '''{
matches(file("target/native/generated/generateTestResourceConfig/resource-config.json").text, '''{
"resources" : {
"includes" : [ {
"pattern" : "\\\\Qmessage.txt\\\\E"
Expand All @@ -104,22 +100,12 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractGraalVMMavenFun
},
"bundles" : [ ]
}''')
} else {
matches(file("target/native/generated/generateResourceConfig/resource-config.json").text, '''{
"resources" : {
"includes" : [ ],
"excludes" : [ ]
},
"bundles" : [ ]
}''')
}

where:
detection | includedPatterns | restrictToModules | detectionExclusionPatterns | ignoreExistingResourcesConfig
false | [Pattern.quote("message.txt"), Pattern.quote("org/graalvm/demo/expected.txt")] | false | [] | true
true | [] | true | [] | false
true | [] | false | ["META-INF/.*", "junit-platform-unique-ids.*"] | true
true | [] | true | ["META-INF/.*", "junit-platform-unique-ids.*"] | true
detection | includedPatterns | restrictToModules | detectionExclusionPatterns
false | [Pattern.quote("message.txt"), Pattern.quote("org/graalvm/demo/expected.txt")] | false | []
true | [] | false | ["META-INF/.*", "junit-platform-unique-ids.*"]
true | [] | true | ["META-INF/.*", "junit-platform-unique-ids.*"]
}

private static String joinForCliArg(List<String> patterns) {
Expand Down

0 comments on commit 64fefce

Please sign in to comment.