From 39feb6b5c43e41b17a7d0090f012811b921d660b Mon Sep 17 00:00:00 2001 From: Matt Pavlovich Date: Thu, 24 Aug 2023 09:29:06 -0500 Subject: [PATCH] [AMQ-9239] jakarta.jms - activemq-client-jakarta relocation and removal --- activemq-client-jakarta/pom.xml | 193 +----------------- .../apache/activemq/jakarta/JakartaTest.java | 86 -------- 2 files changed, 9 insertions(+), 270 deletions(-) delete mode 100644 activemq-client-jakarta/src/test/java/org/apache/activemq/jakarta/JakartaTest.java diff --git a/activemq-client-jakarta/pom.xml b/activemq-client-jakarta/pom.xml index aa0dd7da4e..d868f6e497 100644 --- a/activemq-client-jakarta/pom.xml +++ b/activemq-client-jakarta/pom.xml @@ -23,193 +23,18 @@ 5.19.0-SNAPSHOT activemq-client-jakarta - bundle + pom ActiveMQ :: Client Jakarta Jakarta transition module for ActiveMQ Client implementation true - - - org.apache.activemq - activemq-client - provided - - - jakarta.jms - jakarta.jms-api - - - - - jakarta.jms - jakarta.jms-api - ${jakarta-jms-api-v3-version} - - - org.fusesource.hawtbuf - hawtbuf - ${hawtbuf-version} - - - org.slf4j - slf4j-api - - - org.jmdns - jmdns - true - provided - - - com.thoughtworks.xstream - xstream - provided - - - junit - junit - test - - - - - - maven-dependency-plugin - - - unpack-source - initialize - - unpack - - - - - org.apache.activemq - activemq-client - sources - jar - ${project.build.directory}/copied-sources/activemq-client - **/META-INF/*,**/META-INF/maven/**,**/zeroconf/** - **/** - - - - - - - - com.google.code.maven-replacer-plugin - replacer - - - initialize - - replace - - - - - - ${project.build.directory}/copied-sources/activemq-client/**/*.java - - javax.jms - jakarta.jms - - MULTILINE - - - - - maven-resources-plugin - - - copy-java-source - generate-sources - - copy-resources - - - ${project.build.directory}/generated-sources - - - ${project.build.directory}/copied-sources/activemq-client/org - - - - - - copy-resources - generate-sources - - copy-resources - - - ${project.build.directory}/generated-resources/META-INF - - - ${project.build.directory}/copied-sources/activemq-client/META-INF - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - generate-sources - - add-source - - - - ${project.build.directory}/generated-sources - - - - - add-resource - generate-resources - - add-resource - - - - - ${project.build.directory}/generated-resources - - - - - - - - org.apache.felix - maven-bundle-plugin - true - true - - - - !java.*, - !com.google.errorprone.annotations, - !com.google.errorprone.annotations.concurrent, - com.thoughtworks.xstream.*;resolution:="optional", - * - - - com.google.errorprone.annotations, - com.google.errorprone.annotations.concurrent - - <_noee>true - - - - - + + + org.apache.activemq + activemq-client + ${project.version} + ActiveMQ Jakarta transition client no longer needed. Use activemq-client going forward. + + diff --git a/activemq-client-jakarta/src/test/java/org/apache/activemq/jakarta/JakartaTest.java b/activemq-client-jakarta/src/test/java/org/apache/activemq/jakarta/JakartaTest.java deleted file mode 100644 index fde88cd147..0000000000 --- a/activemq-client-jakarta/src/test/java/org/apache/activemq/jakarta/JakartaTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.jakarta; - -import static org.junit.Assert.*; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.junit.Ignore; -import org.junit.Test; - -import jakarta.jms.Connection; -import jakarta.jms.Destination; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageConsumer; -import jakarta.jms.MessageProducer; -import jakarta.jms.Session; -import jakarta.jms.TextMessage; - -public class JakartaTest { - - @Ignore // NOTE: Remove @Ignore to test manually with local running ActiveMQ broker until we have a Jakarta-supported broker - @Test - public void testJakartaConnection() throws JMSException { - ActiveMQConnectionFactory activemqConnectionFactory = new ActiveMQConnectionFactory("admin", "admin", "tcp://localhost:61616"); - Connection connection = activemqConnectionFactory.createConnection(); - assertTrue(jakarta.jms.Connection.class.isAssignableFrom(connection.getClass())); - connection.start(); - - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - assertTrue(jakarta.jms.Session.class.isAssignableFrom(session.getClass())); - - Destination queue = session.createQueue("JAKARTA.TEST"); - assertTrue(jakarta.jms.Destination.class.isAssignableFrom(queue.getClass())); - - MessageProducer messageProducer = session.createProducer(queue); - assertTrue(jakarta.jms.MessageProducer.class.isAssignableFrom(messageProducer.getClass())); - - String messageText = "Test Jakarta API"; - TextMessage sendMessage = session.createTextMessage(messageText); - assertTrue(jakarta.jms.Message.class.isAssignableFrom(sendMessage.getClass())); - assertTrue(jakarta.jms.TextMessage.class.isAssignableFrom(sendMessage.getClass())); - - messageProducer.send(sendMessage); - - MessageConsumer messageConsumer = session.createConsumer(queue); - assertTrue(jakarta.jms.MessageConsumer.class.isAssignableFrom(messageConsumer.getClass())); - - Message recvMessage = messageConsumer.receive(5000l); - assertNotNull(recvMessage); - assertTrue(jakarta.jms.Message.class.isAssignableFrom(sendMessage.getClass())); - assertTrue(jakarta.jms.TextMessage.class.isAssignableFrom(sendMessage.getClass())); - assertEquals(messageText, TextMessage.class.cast(recvMessage).getText()); - - if(messageConsumer != null) { - try { messageConsumer.close(); } catch (JMSException e) { } - } - - if(messageProducer != null) { - try { messageProducer.close(); } catch (JMSException e) { } - } - - if(session != null) { - try { session.close(); } catch (JMSException e) { } - } - - if(connection != null) { - try { connection.close(); } catch (JMSException e) { } - } - } - -}