From 0be55815ff1dc11e8f571d38b1df9a7ba231dfbf Mon Sep 17 00:00:00 2001 From: David Nestorovic Date: Fri, 7 Mar 2025 17:54:08 +0100 Subject: [PATCH] Add metadata for org.junit.jupiter:junit-jupiter:5.11.0 --- metadata/index.json | 4 ++ .../junit-jupiter/5.11.0/index.json | 7 ++ .../junit-jupiter/5.11.0/jni-config.json | 2 + .../5.11.0/predefined-classes-config.json | 7 ++ .../junit-jupiter/5.11.0/proxy-config.json | 2 + .../junit-jupiter/5.11.0/reflect-config.json | 68 +++++++++++++++++++ .../junit-jupiter/5.11.0/resource-config.json | 14 ++++ .../5.11.0/serialization-config.json | 8 +++ .../junit-jupiter/index.json | 10 +++ tests/src/index.json | 40 ++++++----- .../junit-jupiter/5.11.0/.gitignore | 4 ++ .../junit-jupiter/5.11.0/build.gradle | 34 ++++++++++ .../junit-jupiter/5.11.0/gradle.properties | 2 + .../junit-jupiter/5.11.0/settings.gradle | 13 ++++ .../junit_jupiter/BasicTest.java | 30 ++++++++ .../5.11.0/src/test/resources/resource.txt | 1 + .../5.11.0/user-code-filter.json | 6 ++ .../internal/tck/ContributionTask.java | 13 ++-- 18 files changed, 239 insertions(+), 26 deletions(-) create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/index.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/jni-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/predefined-classes-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/proxy-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/reflect-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/resource-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/5.11.0/serialization-config.json create mode 100644 metadata/org.junit.jupiter/junit-jupiter/index.json create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/.gitignore create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/build.gradle create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/gradle.properties create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/settings.gradle create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/java/org_junit_jupiter/junit_jupiter/BasicTest.java create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/resources/resource.txt create mode 100644 tests/src/org.junit.jupiter/junit-jupiter/5.11.0/user-code-filter.json diff --git a/metadata/index.json b/metadata/index.json index 05ddffc6b..708206e1d 100644 --- a/metadata/index.json +++ b/metadata/index.json @@ -341,6 +341,10 @@ "allowed-packages" : [ "org.jooq" ], "directory" : "org.jooq/jooq", "module" : "org.jooq:jooq" +}, { + "allowed-packages" : [ "org.junit.jupiter" ], + "directory" : "org.junit.jupiter/junit-jupiter", + "module" : "org.junit.jupiter:junit-jupiter" }, { "allowed-packages" : [ "org.liquibase", "liquibase" ], "directory" : "org.liquibase/liquibase-core", diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/index.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/index.json new file mode 100644 index 000000000..9512e972d --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/index.json @@ -0,0 +1,7 @@ +[ + "jni-config.json", + "proxy-config.json", + "reflect-config.json", + "resource-config.json", + "serialization-config.json" +] diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/jni-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/jni-config.json new file mode 100644 index 000000000..32960f8ce --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/jni-config.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/predefined-classes-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/predefined-classes-config.json new file mode 100644 index 000000000..847895071 --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/predefined-classes-config.json @@ -0,0 +1,7 @@ +[ + { + "type":"agent-extracted", + "classes":[ + ] + } +] diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/proxy-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/proxy-config.json new file mode 100644 index 000000000..32960f8ce --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/proxy-config.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/reflect-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/reflect-config.json new file mode 100644 index 000000000..2f5176e34 --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/reflect-config.json @@ -0,0 +1,68 @@ +[ +{ + "condition":{"typeReachable":"org.junit.internal.builders.SuiteMethodBuilder"}, + "name":"basic.BasicTest", + "methods":[{"name":"suite","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor"}, + "name":"basic.BasicTest", + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.ExtensionUtils"}, + "name":"basic.BasicTest", + "queryAllDeclaredConstructors":true +}, +{ + "condition":{"typeReachable":"org.junit.jupiter.engine.descriptor.LifecycleMethodUtils"}, + "name":"basic.BasicTest", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.junit.jupiter.engine.discovery.ClassSelectorResolver"}, + "name":"basic.BasicTest", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests"}, + "name":"basic.BasicTest", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.junit.platform.commons.util.AnnotationUtils"}, + "name":"basic.BasicTest" +}, +{ + "condition":{"typeReachable":"org.junit.platform.commons.util.ReflectionUtils"}, + "name":"basic.BasicTest", + "allDeclaredFields":true, + "allDeclaredClasses":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"resourceTest","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder$DefensiveJUnit4Builder"}, + "name":"basic.BasicTest", + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"}, + "name":"java.security.SecureRandomParameters" +}, +{ + "condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"}, + "name":"sun.security.provider.NativePRNG", + "methods":[{"name":"","parameterTypes":[] }, {"name":"","parameterTypes":["java.security.SecureRandomParameters"] }] +}, +{ + "condition":{"typeReachable":"org.junit.platform.launcher.listeners.OutputDir"}, + "name":"sun.security.provider.SHA", + "methods":[{"name":"","parameterTypes":[] }] +} +] \ No newline at end of file diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/resource-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/resource-config.json new file mode 100644 index 000000000..97f03e0f6 --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/resource-config.json @@ -0,0 +1,14 @@ +{ + "resources":{ + "includes":[{ + "condition":{"typeReachable":"org.junit.platform.launcher.core.LauncherFactory"}, + "pattern":"\\QMETA-INF/services/org.junit.platform.engine.TestEngine\\E" + }, { + "condition":{"typeReachable":"org.junit.platform.launcher.core.LauncherFactory"}, + "pattern":"\\QMETA-INF/services/org.junit.platform.launcher.TestExecutionListener\\E" + }, { + "condition":{"typeReachable":"org.junit.platform.commons.util.ReflectionUtils"}, + "pattern":"\\Qresource.txt\\E" + }]}, + "bundles":[] +} \ No newline at end of file diff --git a/metadata/org.junit.jupiter/junit-jupiter/5.11.0/serialization-config.json b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/serialization-config.json new file mode 100644 index 000000000..d0304f2a1 --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/5.11.0/serialization-config.json @@ -0,0 +1,8 @@ +{ + "types":[ + ], + "lambdaCapturingTypes":[ + ], + "proxies":[ + ] +} \ No newline at end of file diff --git a/metadata/org.junit.jupiter/junit-jupiter/index.json b/metadata/org.junit.jupiter/junit-jupiter/index.json new file mode 100644 index 000000000..c30dea0e4 --- /dev/null +++ b/metadata/org.junit.jupiter/junit-jupiter/index.json @@ -0,0 +1,10 @@ +[ + { + "latest": true, + "metadata-version": "5.11.0", + "module": "org.junit.jupiter:junit-jupiter", + "tested-versions": [ + "5.11.0" + ] + } +] diff --git a/tests/src/index.json b/tests/src/index.json index 54318b2bf..07d1340fa 100644 --- a/tests/src/index.json +++ b/tests/src/index.json @@ -179,28 +179,28 @@ "versions" : [ "2.16.11" ] } ] }, { - "test-project-path" : "io.netty/netty-common/4.1.80.Final", + "test-project-path" : "io.netty/netty-common/4.1.115.Final", "libraries" : [ { "name" : "io.netty:netty-common", - "versions" : [ "4.1.80.Final" ] + "versions" : [ "4.1.115.Final" ] } ] }, { - "test-project-path" : "io.netty/netty-transport/4.1.80.Final", + "test-project-path" : "io.netty/netty-common/4.1.80.Final", "libraries" : [ { - "name" : "io.netty:netty-transport", + "name" : "io.netty:netty-common", "versions" : [ "4.1.80.Final" ] } ] }, { - "test-project-path" : "io.netty/netty-common/4.1.115.Final", + "test-project-path" : "io.netty/netty-transport/4.1.115.Final", "libraries" : [ { - "name" : "io.netty:netty-common", + "name" : "io.netty:netty-transport", "versions" : [ "4.1.115.Final" ] } ] }, { - "test-project-path" : "io.netty/netty-transport/4.1.115.Final", + "test-project-path" : "io.netty/netty-transport/4.1.80.Final", "libraries" : [ { "name" : "io.netty:netty-transport", - "versions" : [ "4.1.115.Final" ] + "versions" : [ "4.1.80.Final" ] } ] }, { "test-project-path" : "io.opentelemetry/opentelemetry-exporter-jaeger/1.19.0", @@ -437,16 +437,16 @@ "versions" : [ "10.15.0" ] } ] }, { - "test-project-path": "org.flywaydb/flyway-core/10.20.0", - "libraries": [ { - "name": "org.flywaydb:flyway-core", - "versions": [ "10.20.0" ] + "test-project-path" : "org.flywaydb/flyway-core/10.20.0", + "libraries" : [ { + "name" : "org.flywaydb:flyway-core", + "versions" : [ "10.20.0" ] } ] }, { - "test-project-path": "org.flywaydb/flyway-core/10.20.1", - "libraries": [ { - "name": "org.flywaydb:flyway-core", - "versions": [ "10.20.1" ] + "test-project-path" : "org.flywaydb/flyway-core/10.20.1", + "libraries" : [ { + "name" : "org.flywaydb:flyway-core", + "versions" : [ "10.20.1" ] } ] }, { "test-project-path" : "org.flywaydb/flyway-core/9.0.1", @@ -586,6 +586,12 @@ "name" : "org.jooq:jooq", "versions" : [ "3.18.2" ] } ] +}, { + "test-project-path" : "org.junit.jupiter/junit-jupiter/5.11.0", + "libraries" : [ { + "name" : "org.junit.jupiter:junit-jupiter", + "versions" : [ "5.11.0" ] + } ] }, { "test-project-path" : "org.liquibase/liquibase-core/4.17.0", "libraries" : [ { @@ -682,4 +688,4 @@ "name" : "samples:docker", "versions" : [ "image-pull" ] } ] -} ] +} ] \ No newline at end of file diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/.gitignore b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/.gitignore new file mode 100644 index 000000000..c98c7875b --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/.gitignore @@ -0,0 +1,4 @@ +gradlew.bat +gradlew +gradle/ +build/ diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/build.gradle b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/build.gradle new file mode 100644 index 000000000..632d6b6f3 --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/build.gradle @@ -0,0 +1,34 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ + +plugins { + id "org.graalvm.internal.tck" +} + +String libraryVersion = tck.testedLibraryVersion.get() + +dependencies { + testImplementation "org.junit.vintage:junit-vintage-engine:5.11.0" + testImplementation "org.junit.jupiter:junit-jupiter:$libraryVersion" + testImplementation 'org.assertj:assertj-core:3.22.0' +} + +graalvmNative { + agent { + defaultMode = "conditional" + modes { + conditional { + userCodeFilterPath = "user-code-filter.json" + } + } + metadataCopy { + mergeWithExisting = false + inputTaskNames.add("test") + outputDirectories.add("/home/dnestoro/work/reachability-metadata/metadata/org.junit.jupiter/junit-jupiter/5.11.0") + } + } +} \ No newline at end of file diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/gradle.properties b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/gradle.properties new file mode 100644 index 000000000..491996ac3 --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/gradle.properties @@ -0,0 +1,2 @@ +library.version = 5.11.0 +metadata.dir = org.junit.jupiter/junit-jupiter/5.11.0/ diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/settings.gradle b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/settings.gradle new file mode 100644 index 000000000..53d56a15b --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/settings.gradle @@ -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.junit.jupiter.junit-jupiter_tests' diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/java/org_junit_jupiter/junit_jupiter/BasicTest.java b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/java/org_junit_jupiter/junit_jupiter/BasicTest.java new file mode 100644 index 000000000..35ee45d54 --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/java/org_junit_jupiter/junit_jupiter/BasicTest.java @@ -0,0 +1,30 @@ +package basic; + +import org.junit.jupiter.api.Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class BasicTest { + + private static final String RESOURCE = "/resource.txt"; + + @Test + public void resourceTest() { + try(InputStream is = BasicTest.class.getResourceAsStream(RESOURCE)) { + assertNotNull(is); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + + assertTrue(br.readLine().equalsIgnoreCase("Hello from resource!")); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/resources/resource.txt b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/resources/resource.txt new file mode 100644 index 000000000..a07388701 --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/src/test/resources/resource.txt @@ -0,0 +1 @@ +Hello from resource! diff --git a/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/user-code-filter.json b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/user-code-filter.json new file mode 100644 index 000000000..0d8a015f4 --- /dev/null +++ b/tests/src/org.junit.jupiter/junit-jupiter/5.11.0/user-code-filter.json @@ -0,0 +1,6 @@ +{ + "rules": [ + {"excludeClasses": "**"}, + {"includeClasses": "org.junit.**"} + ] +} \ No newline at end of file diff --git a/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ContributionTask.java b/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ContributionTask.java index 764436878..12cb00ead 100644 --- a/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ContributionTask.java +++ b/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ContributionTask.java @@ -76,8 +76,7 @@ void run() throws IOException { createPullRequest(pullRequestInfo); } - // TODO ask user to check metadata. If everything is okay, ask user if the task should create a PR for him - + InteractiveTaskUtils.printUserInfo("Contribution successfully completed! Thank you!"); } private Coordinates getCoordinates() { @@ -371,14 +370,9 @@ private void createPullRequest(Map info) { invokeCommand("git", List.of("commit", "-m", "Add metadata for " + coordinates), "Cannot commit changes", null); InteractiveTaskUtils.printUserInfo("Pushing changes"); - String output = invokeCommand("git push origin " + branch, "Cannot push to origin"); - - String pullRequestCreateLink = "https://github.com/oracle/graalvm-reachability-metadata/pull/new/" + branch; - if (!output.contains(pullRequestCreateLink)) { - throw new RuntimeException("Cannot find link for pull request creation"); - } + invokeCommand("git push origin " + branch, "Cannot push to origin"); - InteractiveTaskUtils.printUserInfo("Complete generating your pull request on GitHub: " + pullRequestCreateLink); + InteractiveTaskUtils.printUserInfo("Complete pull request creation on the above link!"); } private void writeToFile(Path path, String content, StandardOpenOption writeOption) throws IOException { @@ -386,6 +380,7 @@ private void writeToFile(Path path, String content, StandardOpenOption writeOpti Files.writeString(path, content, StandardCharsets.UTF_8, writeOption); } + // TODO remove return value private String invokeCommand(String command, String errorMessage) { return invokeCommand(command, errorMessage, null); }