This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-exec.git
The following commit(s) were added to refs/heads/master by this push:
new 494e210b Use SystemProperties instead of magic strings
494e210b is described below
commit 494e210b0f8c7e11b16af2f2992a22fccebbb6bd
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Jul 20 15:00:45 2025 -0400
Use SystemProperties instead of magic strings
---
src/test/java/org/apache/commons/exec/DefaultExecutorTest.java | 3 ++-
src/test/java/org/apache/commons/exec/issues/Exec36Test.java | 3 ++-
src/test/java/org/apache/commons/exec/issues/Exec41Test.java | 5 +++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
b/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
index e28cf1a5..5738624c 100644
--- a/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
+++ b/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
@@ -43,6 +43,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.commons.exec.environment.EnvironmentUtils;
+import org.apache.commons.lang3.SystemProperties;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -456,7 +457,7 @@ class DefaultExecutorTest {
void testExecuteWatchdogSync() throws Exception {
if (OS.isFamilyOpenVms()) {
- System.out.println("The test 'testExecuteWatchdogSync' currently
hangs on the following OS : " + System.getProperty("os.name"));
+ System.out.println("The test 'testExecuteWatchdogSync' currently
hangs on the following OS : " + SystemProperties.getOsName());
return;
}
diff --git a/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
b/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
index 543f666f..25ca4985 100644
--- a/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
+++ b/src/test/java/org/apache/commons/exec/issues/Exec36Test.java
@@ -33,6 +33,7 @@ import org.apache.commons.exec.Executor;
import org.apache.commons.exec.OS;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.exec.TestUtil;
+import org.apache.commons.lang3.SystemProperties;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
@@ -174,7 +175,7 @@ class Exec36Test {
} else if (OS.isFamilyUnix()) {
expected = "dotnetfx.exe\n" + "/q:a\n" + "/c:\"install.exe /l
\"\"/Documents and Settings/myusername/Local Settings/Temp/netfx.log\"\" /q\"";
} else {
- System.err.println("The test 'testExec36_3' does not support the
following OS : " + System.getProperty("os.name"));
+ System.err.println("The test 'testExec36_3' does not support the
following OS : " + SystemProperties.getOsName());
return;
}
diff --git a/src/test/java/org/apache/commons/exec/issues/Exec41Test.java
b/src/test/java/org/apache/commons/exec/issues/Exec41Test.java
index 22e705c6..7f50ec20 100644
--- a/src/test/java/org/apache/commons/exec/issues/Exec41Test.java
+++ b/src/test/java/org/apache/commons/exec/issues/Exec41Test.java
@@ -30,6 +30,7 @@ import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.OS;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.exec.TestUtil;
+import org.apache.commons.lang3.SystemProperties;
import org.junit.jupiter.api.Test;
/**
@@ -98,13 +99,13 @@ class Exec41Test {
if (OS.isFamilyWindows()) {
cmdLine = CommandLine.parse("ping.exe -n 10 -w 1000 127.0.0.1");
- } else if ("HP-UX".equals(System.getProperty("os.name"))) {
+ } else if ("HP-UX".equals(SystemProperties.getOsName())) {
// see EXEC-52 - option must appear after the hostname!
cmdLine = CommandLine.parse("ping 127.0.0.1 -n 10");
} else if (OS.isFamilyUnix()) {
cmdLine = CommandLine.parse("ping -c 10 127.0.0.1");
} else {
- System.err.println("The test 'testExec41WithStreams' does not
support the following OS : " + System.getProperty("os.name"));
+ System.err.println("The test 'testExec41WithStreams' does not
support the following OS : " + SystemProperties.getOsName());
return;
}