From bc55b9d10dc0d6c4a6410730f8574064f53a045d Mon Sep 17 00:00:00 2001
From: Francisco Javier Tirado Sarti
<65240126+fjtirado@users.noreply.github.com>
Date: Mon, 15 Jan 2024 18:02:40 +0100
Subject: [PATCH] [Fix_@818] Fixing native python test on Java 17 (#3349)
---
quarkus/addons/python/integration-tests/pom.xml | 2 +-
.../org/kie/kogito/quarkus/workflows/PythonFlowIT.java | 4 ----
.../main/resources/META-INF/native-image/jni-config.json | 9 +++++++++
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/quarkus/addons/python/integration-tests/pom.xml b/quarkus/addons/python/integration-tests/pom.xml
index c077d2d9123..f5f387151a9 100644
--- a/quarkus/addons/python/integration-tests/pom.xml
+++ b/quarkus/addons/python/integration-tests/pom.xml
@@ -152,7 +152,7 @@
maven-failsafe-plugin
- ${env.JAVA_HOME}/lib/server
+ ${env.JAVA_HOME}/lib/server;${env.GRAALVM_HOME}/lib/server
diff --git a/quarkus/addons/python/integration-tests/src/test/java/org/kie/kogito/quarkus/workflows/PythonFlowIT.java b/quarkus/addons/python/integration-tests/src/test/java/org/kie/kogito/quarkus/workflows/PythonFlowIT.java
index 23d331775ff..75de1ed8b77 100644
--- a/quarkus/addons/python/integration-tests/src/test/java/org/kie/kogito/quarkus/workflows/PythonFlowIT.java
+++ b/quarkus/addons/python/integration-tests/src/test/java/org/kie/kogito/quarkus/workflows/PythonFlowIT.java
@@ -20,7 +20,6 @@
import org.junit.jupiter.api.Test;
-import io.quarkus.test.junit.DisabledOnIntegrationTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.http.ContentType;
@@ -28,9 +27,6 @@
import static org.hamcrest.CoreMatchers.is;
@QuarkusIntegrationTest
-@DisabledOnIntegrationTest(
- value = "Temporarily disabling test since python cannot be properly initialized inside the native image",
- forArtifactTypes = DisabledOnIntegrationTest.ArtifactType.NATIVE_BINARY)
class PythonFlowIT {
@Test
diff --git a/quarkus/addons/python/runtime/src/main/resources/META-INF/native-image/jni-config.json b/quarkus/addons/python/runtime/src/main/resources/META-INF/native-image/jni-config.json
index 6ed2a8dc04f..6814b8c68c2 100644
--- a/quarkus/addons/python/runtime/src/main/resources/META-INF/native-image/jni-config.json
+++ b/quarkus/addons/python/runtime/src/main/resources/META-INF/native-image/jni-config.json
@@ -29,6 +29,7 @@
{
"name": "java.util.Map$Entry[]"
},
+ {"name":"java.lang.reflect.AnnotatedElement", "allPublicMethods": true},
{"name":"java.lang.IllegalStateException","allPublicMethods":true},
{"name":"java.lang.NoSuchMethodError","allPublicMethods":true,"allPublicConstructors":true, "allPublicClasses": true},
{"name":"java.lang.IllegalStateException[]","allPublicMethods":true},
@@ -237,6 +238,10 @@
{
"name": "jep.MainInterpreter"
},
+ {
+ "name": "jep.PyMethod",
+ "allPublicMethods": true
+ },
{
"name": "jep.NDArray",
"allPublicMethods": true,
@@ -245,5 +250,9 @@
{
"name": "jep.ClassList",
"allPublicMethods": true
+ },
+ {
+ "name": "java.lang.reflect.Executable",
+ "allPublicMethods": true
}
]