From a4ba085ef456c9aef832d9c03159182eb20c82e5 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 14:43:24 +0200 Subject: [PATCH 1/6] ARTEMIS-6116 Remove basedir from activemq-surefire-argline --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index c9850b5e4c7..569f89bad12 100644 --- a/pom.xml +++ b/pom.xml @@ -269,7 +269,6 @@ -Djava.library.path="${activemq.basedir}/target/bin/lib/linux-x86_64:${activemq.basedir}/target/bin/lib/linux-i686" -Djgroups.bind_addr=localhost -Djava.net.preferIPv4Stack=true - -Dbasedir=${basedir} -Djdk.attach.allowAttachSelf=true -Dartemis.distribution.output="${artemis.distribution.output}" -Dlog4j2.configurationFile="file:${activemq.basedir}/tests/config/${logging.config}" From 2f491216937030698d7665600046f20d148920a3 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 14:44:00 +0200 Subject: [PATCH 2/6] ARTEMIS-6116 Remove file prefix from activemq-surefire-argline --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 569f89bad12..9b59341939e 100644 --- a/pom.xml +++ b/pom.xml @@ -271,7 +271,7 @@ -Djava.net.preferIPv4Stack=true -Djdk.attach.allowAttachSelf=true -Dartemis.distribution.output="${artemis.distribution.output}" - -Dlog4j2.configurationFile="file:${activemq.basedir}/tests/config/${logging.config}" + -Dlog4j2.configurationFile="${activemq.basedir}/tests/config/${logging.config}" ${project.basedir} false From e1c918ab8b79c0c6babc214b845323ada241fcb3 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 14:49:46 +0200 Subject: [PATCH 3/6] ARTEMIS-6116 Fix NetworkHealthTest for Windows Reduce network timeout checked because windows reports lower timeouts --- .../activemq/artemis/utils/NetworkHealthTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java index f3508008ef2..0d84690864e 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java @@ -327,12 +327,18 @@ public boolean purePing(InetAddress address) throws IOException, InterruptedExce @Test @Timeout(30) public void testPurePingTimeout() throws Exception { - NetworkHealthCheck check = new NetworkHealthCheck(null, 100, 2000); + int timeout = 2000; + + // Add a "tolerance" for Windows, since it reports less time spent in timeout than the networkTimeout parameter (around 200ms) + int tolerance = 500; + + NetworkHealthCheck check = new NetworkHealthCheck(null, 100, timeout); long time = System.currentTimeMillis(); //[RFC1166] reserves the address block 192.0.2.0/24 for test. assertFalse(check.purePing(InetAddress.getByName("192.0.2.0"))); - assertTrue(System.currentTimeMillis() - time >= 2000); + + assertTrue(System.currentTimeMillis() - time >= (timeout - tolerance)); } } From b8a82379e5a5d9b9825068f3cc17901ac13a6619 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 22:07:11 +0200 Subject: [PATCH 4/6] ARTEMIS-6116 Fix "cannot delete resources" error --- .../artemis/core/config/impl/ConfigurationImplTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java index 6d43db8f4b7..b878681dba7 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java @@ -2969,12 +2969,15 @@ public void testRegxPropertiesFilesInDir() throws Exception { File tmpFile = File.createTempFile("a_stuff", ".properties", temporaryFolder); Properties properties = new Properties(); properties.put("name", "a"); - properties.store(new FileOutputStream(tmpFile), null); - + try (FileOutputStream out = new FileOutputStream(tmpFile)) { + properties.store(out, null); + } tmpFile = File.createTempFile("b_stuff", ".0-properties", temporaryFolder); properties = new Properties(); properties.put("name", "0"); - properties.store(new FileOutputStream(tmpFile), null); + try (FileOutputStream out = new FileOutputStream(tmpFile)) { + properties.store(out, null); + } ConfigurationImpl configuration = new ConfigurationImpl(); configuration.parseProperties(temporaryFolder + "/"); From 8e351f42e0e514a6ab864a5e7c611287882e9f21 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 22:16:32 +0200 Subject: [PATCH 5/6] ARTEMIS-6116 Use USERPROFILE on windows --- .../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 c2dac261303..aa5d800493c 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 @@ 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 void testPropertySubstituion(@TempDir Path tempDir) throws Exception { } @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); From 9bb09b3b4e2305f16e01ff2e5e1dd814f7e582d6 Mon Sep 17 00:00:00 2001 From: gchuf Date: Thu, 7 May 2026 22:23:54 +0200 Subject: [PATCH 6/6] ARTEMIS-6116 Replace line endings for stderr --- .../artemis/cli/commands/messages/ProducerThreadTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThreadTest.java b/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThreadTest.java index 813dbf46446..4b784eece42 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThreadTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/messages/ProducerThreadTest.java @@ -225,7 +225,7 @@ public void testBadMessagePropertyType() throws Exception { producer.setProperties(createJsonProperty("myType", "myKey", "myValue")); producer.applyProperties(mockMessage); - assertEquals("Unable to set property: myKey. Did not recognize type: myType. Supported types are: boolean, int, long, byte, short, float, double, string.\n", context.getStderr()); + assertEquals("Unable to set property: myKey. Did not recognize type: myType. Supported types are: boolean, int, long, byte, short, float, double, string.\n", context.getStderr().replace("\r\n", "\n")); } private static String createJsonProperty(String type, String key, String value) {