You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by wu...@apache.org on 2023/03/30 14:49:06 UTC

[shardingsphere] branch master updated: Fix wrong classpath in Espresso context (#24912)

This is an automated email from the ASF dual-hosted git repository.

wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 59c825fedae Fix wrong classpath in Espresso context (#24912)
59c825fedae is described below

commit 59c825fedae458b9c1991fc5a2c73c7f0e27560c
Author: Ling Hengqian <li...@outlook.com>
AuthorDate: Thu Mar 30 22:48:55 2023 +0800

    Fix wrong classpath in Espresso context (#24912)
---
 .../infra/util/expr/EspressoInlineExpressionParser.java             | 2 +-
 .../shardingsphere/infra/util/expr/InlineExpressionParserTest.java  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/expr/EspressoInlineExpressionParser.java b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/expr/EspressoInlineExpressionParser.java
index 5ff3334b01b..c1ed78db7c0 100644
--- a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/expr/EspressoInlineExpressionParser.java
+++ b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/expr/EspressoInlineExpressionParser.java
@@ -44,7 +44,7 @@ public final class EspressoInlineExpressionParser {
         URL resource = Thread.currentThread().getContextClassLoader().getResource("espresso-need-libs");
         assert null != resource;
         String dir = resource.getPath();
-        String javaClasspath = String.join(":", dir + "/groovy.jar", dir + "/guava.jar", dir + "/shardingsphere-infra-util.jar");
+        String javaClasspath = String.join(":", dir + "/groovy.jar", dir + "/guava.jar", dir + "/shardingsphere-infra-util-groovy.jar");
         POLYGLOT = Context.newBuilder().allowAllAccess(true)
                 .option("java.Properties.org.graalvm.home", javaHome)
                 .option("java.MultiThreaded", "true")
diff --git a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/expr/InlineExpressionParserTest.java b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/expr/InlineExpressionParserTest.java
index f68edf39d1e..2649dd283db 100644
--- a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/expr/InlineExpressionParserTest.java
+++ b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/expr/InlineExpressionParserTest.java
@@ -18,6 +18,7 @@
 package org.apache.shardingsphere.infra.util.expr;
 
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
 
 import java.util.Collections;
 import java.util.List;
@@ -120,9 +121,8 @@ class InlineExpressionParserTest {
      * Because `org.graalvm.polyglot.Value#as` does not allow this type to be returned from the guest JVM.
      */
     @Test
+    @DisabledInNativeImage
     void assertEvaluateClosure() {
-        if (!System.getProperty("java.vm.name").equals("Substrate VM")) {
-            assertThat(new InlineExpressionParser("${1+2}").evaluateClosure().call().toString(), is("3"));
-        }
+        assertThat(new InlineExpressionParser("${1+2}").evaluateClosure().call().toString(), is("3"));
     }
 }