Restore JMS to use ActiveMQ
This commit moves back the JMS-related integration tests to ActiveMQ. They were previously migrated to Artemis, as ActiveMQ did not have support for Jakarta. This is also due to Artemis not working on Java 23, see https://issues.apache.org/jira/browse/ARTEMIS-4975 fore more details. Closes gh-1482
This commit is contained in:
@@ -8,6 +8,7 @@ javaPlatform {
|
||||
|
||||
dependencies {
|
||||
api(platform("org.apache.logging.log4j:log4j-bom:2.19.0"))
|
||||
api(platform("org.apache.activemq:activemq-bom:6.1.5"))
|
||||
api(platform("org.eclipse.jetty:jetty-bom:12.0.16"))
|
||||
api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.16"))
|
||||
api(platform("org.junit:junit-bom:5.11.0"))
|
||||
@@ -32,7 +33,6 @@ dependencies {
|
||||
api("jaxen:jaxen:1.1.6")
|
||||
api("net.minidev:json-smart:2.5.2")
|
||||
api("net.sf.ehcache:ehcache:2.10.9.2")
|
||||
api("org.apache.activemq:artemis-jakarta-server:2.33.0")
|
||||
api("org.apache.commons:commons-collections4:4.4")
|
||||
api("org.apache.httpcomponents.client5:httpclient5:5.2.3")
|
||||
api("org.apache.httpcomponents:httpclient:4.5.14")
|
||||
|
||||
@@ -30,7 +30,7 @@ dependencies {
|
||||
exclude(group: "commons-logging", module: "commons-logging")
|
||||
}
|
||||
testImplementation("jakarta.annotation:jakarta.annotation-api")
|
||||
testImplementation("org.apache.activemq:artemis-jakarta-server") {
|
||||
testImplementation("org.apache.activemq:activemq-broker") {
|
||||
exclude(group: "commons-logging", module: "commons-logging")
|
||||
}
|
||||
testImplementation("org.apache.logging.log4j:log4j-core")
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
*/
|
||||
package org.springframework.ws.transport.jms;
|
||||
|
||||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
|
||||
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
@@ -39,24 +34,6 @@ public class JmsIntegrationTest {
|
||||
@Autowired
|
||||
private WebServiceTemplate webServiceTemplate;
|
||||
|
||||
private static EmbeddedActiveMQ server;
|
||||
|
||||
@BeforeAll
|
||||
static void setUp() throws Exception {
|
||||
Configuration config = new ConfigurationImpl();
|
||||
config.addAcceptorConfiguration("vm", "vm://0");
|
||||
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
|
||||
config.setSecurityEnabled(false);
|
||||
server = new EmbeddedActiveMQ();
|
||||
server.setConfiguration(config);
|
||||
server.start();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDown() throws Exception {
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTemporaryQueue() {
|
||||
String content = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
|
||||
|
||||
@@ -24,10 +24,6 @@ import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.TextMessage;
|
||||
import jakarta.xml.soap.MessageFactory;
|
||||
import jakarta.xml.soap.SOAPConstants;
|
||||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
|
||||
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -59,24 +55,9 @@ public class JmsMessageSenderIntegrationTest {
|
||||
|
||||
private static final String SOAP_ACTION = "\"http://springframework.org/DoIt\"";
|
||||
|
||||
private EmbeddedActiveMQ server;
|
||||
|
||||
@BeforeEach
|
||||
public void createMessageFactory() throws Exception {
|
||||
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
|
||||
Configuration config = new ConfigurationImpl();
|
||||
config.addAcceptorConfiguration("vm", "vm://0");
|
||||
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
|
||||
config.setSecurityEnabled(false);
|
||||
server = new EmbeddedActiveMQ();
|
||||
server.setConfiguration(config);
|
||||
server.start();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() throws Exception {
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -23,11 +23,6 @@ import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.TextMessage;
|
||||
import jakarta.jms.Topic;
|
||||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
|
||||
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
@@ -62,25 +57,6 @@ public class WebServiceMessageListenerIntegrationTest {
|
||||
@Autowired
|
||||
private Topic requestTopic;
|
||||
|
||||
private EmbeddedActiveMQ server;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() throws Exception {
|
||||
|
||||
Configuration config = new ConfigurationImpl();
|
||||
config.addAcceptorConfiguration("vm", "vm://0");
|
||||
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
|
||||
config.setSecurityEnabled(false);
|
||||
server = new EmbeddedActiveMQ();
|
||||
server.setConfiguration(config);
|
||||
server.start();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() throws Exception {
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReceiveQueueBytesMessage() {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
|
||||
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
|
||||
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
|
||||
<property name="address" value="RequestQueue"/>
|
||||
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="RequestQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestTopic" class="org.apache.activemq.artemis.jms.client.ActiveMQTopic">
|
||||
<property name="address" value="RequestTopic"/>
|
||||
<bean id="requestTopic" class="org.apache.activemq.command.ActiveMQTopic">
|
||||
<property name="physicalName" value="RequestTopic"/>
|
||||
</bean>
|
||||
|
||||
<bean id="responseQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
|
||||
<property name="address" value="ResponseQueue"/>
|
||||
<bean id="responseQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="ResponseQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
|
||||
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
|
||||
<property name="address" value="SenderRequestQueue"/>
|
||||
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="SenderRequestQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="responseQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
|
||||
<property name="address" value="SenderResponseQueue"/>
|
||||
<bean id="responseQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="SenderResponseQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||
|
||||
Reference in New Issue
Block a user