You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@artemis.apache.org by jb...@apache.org on 2026/09/03 16:31:15 UTC
(artemis) 04/14: ARTEMIS-6116 Use USERPROFILE on Windows
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/artemis.git
commit bcad11d3145d180bcd1b1aac41807ad29bf858f9
Author: gchuf <ga...@gmail.com>
AuthorDate: Thu May 7 22:16:32 2026 +0200
ARTEMIS-6116 Use USERPROFILE on Windows
---
.../java/org/apache/activemq/artemis/dto/XmlUtilTest.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/artemis-dto/src/test/java/org/apache/activemq/artemis/dto/XmlUtilTest.java b/artemis-dto/src/test/java/org/apache/activemq/artemis/dto/XmlUtilTest.java
index c2dac26130..aa5d800493 100644
--- a/artemis-dto/src/test/java/org/apache/activemq/artemis/dto/XmlUtilTest.java
+++ b/artemis-dto/src/test/java/org/apache/activemq/artemis/dto/XmlUtilTest.java
@@ -30,13 +30,18 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class XmlUtilTest extends ArtemisTestCase {
@Test
- public void testPropertySubstituion(@TempDir Path tempDir) throws Exception {
+ public void testPropertySubstitution(@TempDir Path tempDir) throws Exception {
final String SYSTEM_PROP_NAME = getTestMethodName() + "SysPropName";
final String SYSTEM_PROP_VALUE = getTestMethodName() + "SysPropValue";
System.setProperty(SYSTEM_PROP_NAME, SYSTEM_PROP_VALUE);
// since System.getenv() returns an immutable Map we rely here on an environment variable that is likely to exist
- final String ENV_VAR_NAME = "HOME";
+ String ENV_VAR_NAME = "HOME";
+
+ // override to USERPROFILE if OS is windows
+ if (System.getProperty("os.name").toLowerCase().contains("win")) {
+ ENV_VAR_NAME = "USERPROFILE";
+ }
BrokerDTO brokerDTO = getBrokerDTO(tempDir, SYSTEM_PROP_NAME, ENV_VAR_NAME);
assertEquals(SYSTEM_PROP_VALUE, ((JaasSecurityDTO)brokerDTO.security).domain);
@@ -44,7 +49,7 @@ public class XmlUtilTest extends ArtemisTestCase {
}
@Test
- public void testPropertySubstituionPrecedence(@TempDir Path tempDir) throws Exception {
+ public void testPropertySubstitutionPrecedence(@TempDir Path tempDir) throws Exception {
final String SYSTEM_PROP_NAME = "HOME";
final String SYSTEM_PROP_VALUE = getTestMethodName() + "SysPropValue";
System.setProperty(SYSTEM_PROP_NAME, SYSTEM_PROP_VALUE);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@artemis.apache.org
For additional commands, e-mail: commits-help@artemis.apache.org