From b31cc6f2cb6cc5092660279c7b21a06546eddafb Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Thu, 3 Mar 2022 16:51:08 -0500 Subject: [PATCH] AMQ-7309: Compilation fixes after revert of JMS 2.0 api change --- .../org/apache/activemq/JMSMessageTest.java | 20 -------------- .../org/apache/activemq/bugs/AMQ5212Test.java | 7 +++-- .../org/apache/activemq/bugs/AMQ6122Test.java | 9 ++++--- .../jdbc/JDBCIOExceptionHandlerTest.java | 26 +++---------------- 4 files changed, 12 insertions(+), 50 deletions(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java index f4749a1169..a22e5e9dfc 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java @@ -373,16 +373,6 @@ public class JMSMessageTest extends JmsTestSupport { expiration = arg0; } - @Override - public long getJMSDeliveryTime() throws JMSException { - return 0; - } - - @Override - public void setJMSDeliveryTime(long l) throws JMSException { - - } - @Override public int getJMSPriority() throws JMSException { return priority; @@ -498,16 +488,6 @@ public class JMSMessageTest extends JmsTestSupport { public void clearBody() throws JMSException { } - @Override - public T getBody(Class aClass) throws JMSException { - return null; - } - - @Override - public boolean isBodyAssignableTo(Class aClass) throws JMSException { - return true; - } - @Override public void setText(String arg0) throws JMSException { text = arg0; diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java index f5d51d1946..cc2602d291 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java @@ -29,7 +29,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import javax.jms.CompletionListener; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.Session; @@ -124,7 +123,7 @@ public class AMQ5212Test { } ActiveMQTextMessage message = new ActiveMQTextMessage(); message.setDestination(dest); - activeMQMessageProducer.send(message, (CompletionListener) null); + activeMQMessageProducer.send(message, null); // send a duplicate activeMQConnection.syncSendPacket(message); @@ -165,7 +164,7 @@ public class AMQ5212Test { ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest); ActiveMQTextMessage message = new ActiveMQTextMessage(); message.setDestination(dest); - activeMQMessageProducer.send(message, (CompletionListener) null); + activeMQMessageProducer.send(message, null); // send a duplicate activeMQConnection.syncSendPacket(message); @@ -210,7 +209,7 @@ public class AMQ5212Test { ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest); ActiveMQTextMessage message = new ActiveMQTextMessage(); message.setDestination(dest); - activeMQMessageProducer.send(message, (CompletionListener) null); + activeMQMessageProducer.send(message, null); // send a duplicate activeMQConnection.syncSendPacket(message); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6122Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6122Test.java index 2c316ad744..220d7fe795 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6122Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ6122Test.java @@ -21,7 +21,10 @@ import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.List; -import javax.jms.*; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.Session; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; @@ -108,7 +111,7 @@ public class AMQ6122Test { ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest); ActiveMQTextMessage message = new ActiveMQTextMessage(); message.setDestination(dest); - activeMQMessageProducer.send(message, (CompletionListener) null); + activeMQMessageProducer.send(message, null); // send a duplicate activeMQConnection.syncSendPacket(message); @@ -146,7 +149,7 @@ public class AMQ6122Test { @Override public void run() { try { - producer.send(message, (CompletionListener) null); + producer.send(message, null); } catch (JMSException e) { e.printStackTrace(); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCIOExceptionHandlerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCIOExceptionHandlerTest.java index 2f212ae47c..13bec547ee 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCIOExceptionHandlerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCIOExceptionHandlerTest.java @@ -16,35 +16,20 @@ */ package org.apache.activemq.store.jdbc; -import java.io.File; -import java.io.IOException; -import java.io.ObjectInputStream; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.PrintWriter; -import java.net.Socket; -import java.rmi.registry.Registry; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; - import javax.jms.Connection; -import javax.management.*; -import javax.management.loading.ClassLoaderRepository; -import javax.management.remote.JMXConnectorServer; -import javax.management.remote.JMXConnectorServerFactory; -import javax.management.remote.JMXServiceURL; - import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.ft.SyncCreateDataSource; -import org.apache.activemq.broker.jmx.ManagementContext; import org.apache.activemq.bugs.embedded.ThreadExplorer; -import org.apache.activemq.util.DefaultTestAppender; -import org.apache.activemq.util.IOHelper; import org.apache.activemq.util.LeaseLockerIOExceptionHandler; import org.apache.activemq.util.Wait; import org.apache.derby.jdbc.EmbeddedDataSource; @@ -56,15 +41,10 @@ import org.apache.logging.log4j.core.config.Property; import org.apache.logging.log4j.core.filter.AbstractFilter; import org.apache.logging.log4j.core.layout.MessageLayout; import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * Test to see if the JDBCExceptionIOHandler will restart the transport connectors correctly after * the underlying DB has been stopped and restarted