diff --git a/deps/rabbit/test/amqp_jms_SUITE.erl b/deps/rabbit/test/amqp_jms_SUITE.erl
index 7a5462eda3..d0fcfc9904 100644
--- a/deps/rabbit/test/amqp_jms_SUITE.erl
+++ b/deps/rabbit/test/amqp_jms_SUITE.erl
@@ -122,10 +122,8 @@ jms_temporary_queue(Config) ->
%% Send different message types from JMS client to JMS client.
message_types_jms_to_jms(Config) ->
- TestName = QName = atom_to_binary(?FUNCTION_NAME),
- ok = declare_queue(QName, <<"quorum">>, Config),
- ok = run_jms_test(TestName, [{"-Dqueue=~ts", [rabbitmq_amqp_address:queue(QName)]}], Config),
- ok = delete_queue(QName, Config).
+ TestName = atom_to_binary(?FUNCTION_NAME),
+ ok = run_jms_test(TestName, [], Config).
%% Send different message types from JMS client to Erlang AMQP 1.0 client.
message_types_jms_to_amqp(Config) ->
@@ -133,10 +131,8 @@ message_types_jms_to_amqp(Config) ->
ok = run_jms_test(TestName, [], Config).
temporary_queue_rpc(Config) ->
- TestName = QName = atom_to_binary(?FUNCTION_NAME),
- ok = declare_queue(QName, <<"classic">>, Config),
- ok = run_jms_test(TestName, [{"-Dqueue=~ts", [rabbitmq_amqp_address:queue(QName)]}], Config),
- ok = delete_queue(QName, Config).
+ TestName = atom_to_binary(?FUNCTION_NAME),
+ ok = run_jms_test(TestName, [], Config).
temporary_queue_delete(Config) ->
TestName = atom_to_binary(?FUNCTION_NAME),
diff --git a/deps/rabbit/test/amqp_jms_SUITE_data/pom.xml b/deps/rabbit/test/amqp_jms_SUITE_data/pom.xml
index 4d3219578b..c18e63ce1b 100644
--- a/deps/rabbit/test/amqp_jms_SUITE_data/pom.xml
+++ b/deps/rabbit/test/amqp_jms_SUITE_data/pom.xml
@@ -89,6 +89,26 @@
+ origin/main
+
+ // The contents of this file are subject to the Mozilla Public License
+ // Version 2.0 (the "License"); you may not use this file except in
+ // compliance with the License. You may obtain a copy of the License
+ // at https://www.mozilla.org/en-US/MPL/2.0/
+ //
+ // Software distributed under the License is distributed on an "AS IS"
+ // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ // the License for the specific language governing rights and
+ // limitations under the License.
+ //
+ // The Original Code is RabbitMQ.
+ //
+ // The Initial Developer of the Original Code is Pivotal Software, Inc.
+ // Copyright (c) $YEAR Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc.
+ // and/or its subsidiaries. All rights reserved.
+ //
+
+
diff --git a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsConnectionTest.java b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsConnectionTest.java
index d526cbbee4..e784e5455c 100644
--- a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsConnectionTest.java
+++ b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsConnectionTest.java
@@ -14,7 +14,6 @@
// Copyright (c) 2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc.
// and/or its subsidiaries. All rights reserved.
//
-
package com.rabbitmq.amqp.tests.jms;
import static com.rabbitmq.amqp.tests.jms.Cli.startBroker;
@@ -41,12 +40,12 @@ import org.junit.jupiter.api.Timeout;
@JmsTestInfrastructure
public class JmsConnectionTest {
- String destination;
+ ConnectionFactory factory;
@Test
@Timeout(30)
public void testCreateConnection() throws Exception {
- try (Connection connection = connection()) {
+ try (Connection connection = factory.createConnection()) {
assertNotNull(connection);
}
}
@@ -54,7 +53,7 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
public void testCreateConnectionAndStart() throws Exception {
- try (Connection connection = connection()) {
+ try (Connection connection = factory.createConnection()) {
assertNotNull(connection);
connection.start();
}
@@ -65,7 +64,6 @@ public class JmsConnectionTest {
// Currently not supported by RabbitMQ.
@Disabled
public void testCreateWithDuplicateClientIdFails() throws Exception {
- JmsConnectionFactory factory = (JmsConnectionFactory) connectionFactory();
JmsConnection connection1 = (JmsConnection) factory.createConnection();
connection1.setClientID("Test");
assertNotNull(connection1);
@@ -89,7 +87,7 @@ public class JmsConnectionTest {
assertThrows(
JMSException.class,
() -> {
- try (Connection connection = connection()) {
+ try (Connection connection = factory.createConnection()) {
connection.setClientID("Test");
connection.start();
connection.setClientID("NewTest");
@@ -100,9 +98,10 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
public void testCreateConnectionAsSystemAdmin() throws Exception {
- JmsConnectionFactory factory = (JmsConnectionFactory) connectionFactory();
- factory.setUsername(adminUsername());
- factory.setPassword(adminPassword());
+ JmsConnectionFactory f = (JmsConnectionFactory) factory;
+
+ f.setUsername(adminUsername());
+ f.setPassword(adminPassword());
try (Connection connection = factory.createConnection()) {
assertNotNull(connection);
connection.start();
@@ -112,8 +111,7 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
public void testCreateConnectionCallSystemAdmin() throws Exception {
- try (Connection connection =
- connectionFactory().createConnection(adminUsername(), adminPassword())) {
+ try (Connection connection = factory.createConnection(adminUsername(), adminPassword())) {
assertNotNull(connection);
connection.start();
}
@@ -121,13 +119,13 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
- public void testCreateConnectionAsUnknwonUser() {
+ public void testCreateConnectionAsUnknownUser() {
assertThrows(
JMSSecurityException.class,
() -> {
- JmsConnectionFactory factory = (JmsConnectionFactory) connectionFactory();
- factory.setUsername("unknown");
- factory.setPassword("unknown");
+ JmsConnectionFactory f = (JmsConnectionFactory) factory;
+ f.setUsername("unknown");
+ f.setPassword("unknown");
try (Connection connection = factory.createConnection()) {
assertNotNull(connection);
connection.start();
@@ -137,11 +135,11 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
- public void testCreateConnectionCallUnknwonUser() {
+ public void testCreateConnectionCallUnknownUser() {
assertThrows(
JMSSecurityException.class,
() -> {
- try (Connection connection = connectionFactory().createConnection("unknown", "unknown")) {
+ try (Connection connection = factory.createConnection("unknown", "unknown")) {
assertNotNull(connection);
connection.start();
}
@@ -150,11 +148,10 @@ public class JmsConnectionTest {
@Test
@Timeout(30)
- public void testBrokerStopWontHangConnectionClose() throws Exception {
- Connection connection = connection();
+ public void testBrokerStopWontHangConnectionClose(Queue queue) throws Exception {
+ Connection connection = factory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = queue(destination);
connection.start();
MessageProducer producer = session.createProducer(queue);
@@ -179,7 +176,7 @@ public class JmsConnectionTest {
@Timeout(60)
public void testConnectionExceptionBrokerStop() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
- try (Connection connection = connection()) {
+ try (Connection connection = factory.createConnection()) {
connection.setExceptionListener(exception -> latch.countDown());
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
diff --git a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTemporaryQueueTest.java b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTemporaryQueueTest.java
index ae60fa4b8a..dd2665dbba 100644
--- a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTemporaryQueueTest.java
+++ b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTemporaryQueueTest.java
@@ -14,11 +14,9 @@
// Copyright (c) 2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc.
// and/or its subsidiaries. All rights reserved.
//
-
package com.rabbitmq.amqp.tests.jms;
import static com.rabbitmq.amqp.tests.jms.TestUtils.brokerUri;
-import static com.rabbitmq.amqp.tests.jms.TestUtils.connection;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.fail;
@@ -35,13 +33,16 @@ import org.junit.jupiter.api.Timeout;
* Based on
* https://github.com/apache/qpid-jms/tree/main/qpid-jms-interop-tests/qpid-jms-activemq-tests.
*/
+@JmsTestInfrastructure
public class JmsTemporaryQueueTest {
+ ConnectionFactory factory;
+
Connection connection;
@BeforeEach
void init() throws JMSException {
- connection = connection();
+ connection = factory.createConnection();
}
@AfterEach
diff --git a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTest.java b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTest.java
index 71e736a4e0..eaa0e7a9c3 100644
--- a/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTest.java
+++ b/deps/rabbit/test/amqp_jms_SUITE_data/src/test/java/com/rabbitmq/amqp/tests/jms/JmsTest.java
@@ -1,3 +1,19 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 2.0 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License
+// at https://www.mozilla.org/en-US/MPL/2.0/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+// the License for the specific language governing rights and
+// limitations under the License.
+//
+// The Original Code is RabbitMQ.
+//
+// The Initial Developer of the Original Code is Pivotal Software, Inc.
+// Copyright (c) 2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc.
+// and/or its subsidiaries. All rights reserved.
+//
package com.rabbitmq.amqp.tests.jms;
import static com.rabbitmq.amqp.tests.jms.TestUtils.protonClient;
@@ -5,209 +21,175 @@ import static com.rabbitmq.amqp.tests.jms.TestUtils.protonConnection;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
-import jakarta.jms.*;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import javax.naming.Context;
-
import com.rabbitmq.qpid.protonj2.client.Client;
import com.rabbitmq.qpid.protonj2.client.Delivery;
import com.rabbitmq.qpid.protonj2.client.Receiver;
+import jakarta.jms.*;
import jakarta.jms.Queue;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
import org.junit.jupiter.api.Test;
@JmsTestInfrastructure
public class JmsTest {
- private javax.naming.Context getContext() throws Exception{
- // Configure a JNDI initial context, see
- // https://github.com/apache/qpid-jms/blob/main/qpid-jms-docs/Configuration.md#configuring-a-jndi-initialcontext
- Hashtable