From 41100302b2dba76a8463c6e78de508645a7ba2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Wed, 6 Apr 2022 12:39:56 +0200 Subject: [PATCH] Backport #849 --- .../tycho/surefire/AbstractTestMojo.java | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractTestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractTestMojo.java index fa56682ed4..f9363f74ba 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractTestMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractTestMojo.java @@ -14,11 +14,15 @@ * Bachmann electrontic GmbH - 510425 parallel mode requires threadCount>1 or useUnlimitedThreads=true * Christoph Läubrich - [Bug 529929] improve error message in case of failures * - [Bug 572420] Tycho-Surefire should be executable for eclipse-plugin package type + * - [Issue 790] Support printing of bundle wirings in tycho-surefire-plugin + * - [Issue 849] JAVA_HOME check is not OS independent + * - [Issue 790] Support printing of bundle wirings in tycho-surefire-plugin ******************************************************************************/ package org.eclipse.tycho.surefire; import java.io.BufferedOutputStream; import java.io.File; +import java.io.FileFilter; import java.io.FileOutputStream; import java.io.IOException; import java.net.MalformedURLException; @@ -34,6 +38,7 @@ import java.util.Set; import java.util.StringJoiner; +import org.apache.commons.io.FilenameUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; @@ -102,6 +107,8 @@ public abstract class AbstractTestMojo extends AbstractMojo { + private static final String SYSTEM_JDK = "jdk"; + private static String[] UNIX_SIGNAL_NAMES = { "not a signal", // padding, signals start with 1 "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", @@ -110,6 +117,8 @@ public abstract class AbstractTestMojo extends AbstractMojo { private static final Object LOCK = new Object(); + private static final String[] JAVA_EXECUTABLES = { "java", "java.exe" }; + /** * Root directory ( 0) { + return listFiles[0]; + } + return null; + } + private Map getMergedSystemProperties() { Map result = new LinkedHashMap<>(); // bug 415489: use osgi.clean=true by default