From 957a2dd9408d22328829a04ce1780406dc7600e4 Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Tue, 8 Mar 2022 11:10:16 -0500 Subject: [PATCH] AMQ-8528: Fix JMS 2.0 related test failures --- .../java/org/apache/activemq/bugs/AMQ5212Test.java | 10 ++++------ .../java/org/apache/activemq/bugs/AMQ6122Test.java | 11 +++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) 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..8979323ad6 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 @@ -28,16 +28,14 @@ import java.util.concurrent.ExecutorService; 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; - import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQMessageProducer; import org.apache.activemq.ActiveMQSession; +import org.apache.activemq.AsyncCallback; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.MutableBrokerFilter; import org.apache.activemq.broker.ProducerBrokerExchange; @@ -124,7 +122,7 @@ public class AMQ5212Test { } ActiveMQTextMessage message = new ActiveMQTextMessage(); message.setDestination(dest); - activeMQMessageProducer.send(message, (CompletionListener) null); + activeMQMessageProducer.send(message, (AsyncCallback) null); // send a duplicate activeMQConnection.syncSendPacket(message); @@ -165,7 +163,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, (AsyncCallback) null); // send a duplicate activeMQConnection.syncSendPacket(message); @@ -210,7 +208,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, (AsyncCallback) 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..d43ca935cd 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 @@ -20,13 +20,16 @@ import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.List; - -import javax.jms.*; - +import javax.jms.CompletionListener; +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; import org.apache.activemq.ActiveMQMessageProducer; import org.apache.activemq.ActiveMQSession; +import org.apache.activemq.AsyncCallback; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.PolicyEntry; import org.apache.activemq.broker.region.policy.PolicyMap; @@ -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, (AsyncCallback) null); // send a duplicate activeMQConnection.syncSendPacket(message);