You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/01/10 07:38:15 UTC

[camel-quarkus] branch main updated: perf-regression: try resolving 'java.home' system property first in itest #4023

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

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 3fd08fe09f perf-regression: try resolving 'java.home' system property first in itest #4023
3fd08fe09f is described below

commit 3fd08fe09fa8e792c9dbdd1cc1f4474bcc7496bb
Author: aldettinger <al...@gmail.com>
AuthorDate: Mon Jan 9 16:38:55 2023 +0100

    perf-regression: try resolving 'java.home' system property first in itest #4023
---
 .../performance/regression/it/PerfRegressionIT.java        | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tooling/perf-regression/src/test/java/org/apache/camel/quarkus/performance/regression/it/PerfRegressionIT.java b/tooling/perf-regression/src/test/java/org/apache/camel/quarkus/performance/regression/it/PerfRegressionIT.java
index fc130ee2a5..a436c885ab 100644
--- a/tooling/perf-regression/src/test/java/org/apache/camel/quarkus/performance/regression/it/PerfRegressionIT.java
+++ b/tooling/perf-regression/src/test/java/org/apache/camel/quarkus/performance/regression/it/PerfRegressionIT.java
@@ -17,6 +17,9 @@
 package org.apache.camel.quarkus.performance.regression.it;
 
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.concurrent.TimeoutException;
 import java.util.stream.Stream;
 
@@ -75,8 +78,17 @@ public class PerfRegressionIT {
         try {
             String cqVersion = System.getProperty("camel.quarkus.version");
 
+            String javaCommand = "java";
+            String javaHome = System.getProperty("java.home");
+            if (javaHome != null) {
+                Path javaExecutablePath = Paths.get(javaHome, "bin", "java");
+                if (Files.exists(javaExecutablePath)) {
+                    javaCommand = javaExecutablePath.toString();
+                }
+            }
+
             String processOutput = new ProcessExecutor()
-                    .command("java", "-jar", "target/quarkus-app/quarkus-run.jar", "-d", "1s", cqVersion)
+                    .command(javaCommand, "-jar", "target/quarkus-app/quarkus-run.jar", "-d", "1s", cqVersion)
                     .environment("LANG", locale + ".UTF-8")
                     .readOutput(true)
                     .exitValue(0)