[AMQ-8456] Fix unit test compilation

This commit is contained in:
Jean-Baptiste Onofré 2022-01-12 20:36:29 +01:00
parent 0585a2998d
commit ff134fd135
4 changed files with 27 additions and 11 deletions

View File

@ -373,6 +373,16 @@ 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;
@ -488,6 +498,16 @@ public class JMSMessageTest extends JmsTestSupport {
public void clearBody() throws JMSException {
}
@Override
public <T> T getBody(Class<T> 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;

View File

@ -29,6 +29,7 @@ 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;
@ -123,7 +124,7 @@ public class AMQ5212Test {
}
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setDestination(dest);
activeMQMessageProducer.send(message, null);
activeMQMessageProducer.send(message, (CompletionListener) null);
// send a duplicate
activeMQConnection.syncSendPacket(message);
@ -164,7 +165,7 @@ public class AMQ5212Test {
ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest);
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setDestination(dest);
activeMQMessageProducer.send(message, null);
activeMQMessageProducer.send(message, (CompletionListener) null);
// send a duplicate
activeMQConnection.syncSendPacket(message);
@ -209,7 +210,7 @@ public class AMQ5212Test {
ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest);
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setDestination(dest);
activeMQMessageProducer.send(message, null);
activeMQMessageProducer.send(message, (CompletionListener) null);
// send a duplicate
activeMQConnection.syncSendPacket(message);

View File

@ -21,10 +21,7 @@ import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.List;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.*;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
@ -111,7 +108,7 @@ public class AMQ6122Test {
ActiveMQMessageProducer activeMQMessageProducer = (ActiveMQMessageProducer) activeMQSession.createProducer(dest);
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setDestination(dest);
activeMQMessageProducer.send(message, null);
activeMQMessageProducer.send(message, (CompletionListener) null);
// send a duplicate
activeMQConnection.syncSendPacket(message);
@ -149,7 +146,7 @@ public class AMQ6122Test {
@Override
public void run() {
try {
producer.send(message, null);
producer.send(message, (CompletionListener) null);
} catch (JMSException e) {
e.printStackTrace();
}

View File

@ -38,8 +38,6 @@ import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
import com.sun.jndi.rmi.registry.RegistryContext;
import com.sun.jndi.rmi.registry.RegistryContextFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.ft.SyncCreateDataSource;