[AMQ-9239] jakarta.jms - activemq-ra, activemq-rar changes

This commit is contained in:
Matt Pavlovich 2023-03-30 11:37:12 -05:00
parent 4faad74272
commit 5473ea58e5
42 changed files with 646 additions and 360 deletions

View File

@ -49,8 +49,8 @@
<artifactId>activemq-kahadb-store</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
<groupId>jakarta.resource</groupId>
<artifactId>jakarta.resource-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.Topic;
import javax.resource.ResourceException;
import javax.resource.spi.InvalidPropertyException;
import javax.resource.spi.ResourceAdapter;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.InvalidPropertyException;
import jakarta.resource.spi.ResourceAdapter;
import org.apache.activemq.RedeliveryPolicy;
import org.apache.activemq.command.ActiveMQDestination;

View File

@ -18,18 +18,18 @@ package org.apache.activemq.ra;
import java.io.Serializable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSContext;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSContext;
import jakarta.jms.JMSException;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicConnectionFactory;
import javax.naming.Reference;
import javax.resource.Referenceable;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionManager;
import jakarta.resource.Referenceable;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -62,14 +62,14 @@ public class ActiveMQConnectionFactory implements ConnectionFactory, QueueConnec
}
/**
* @see javax.jms.ConnectionFactory#createConnection()
* @see jakarta.jms.ConnectionFactory#createConnection()
*/
public Connection createConnection() throws JMSException {
return createConnection(info.copy());
}
/**
* @see javax.jms.ConnectionFactory#createConnection(java.lang.String,
* @see jakarta.jms.ConnectionFactory#createConnection(java.lang.String,
* java.lang.String)
*/
public Connection createConnection(String userName, String password) throws JMSException {

View File

@ -18,7 +18,7 @@ package org.apache.activemq.ra;
import java.io.Serializable;
import javax.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.ConnectionRequestInfo;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQPrefetchPolicy;

View File

@ -16,7 +16,7 @@
*/
package org.apache.activemq.ra;
import javax.jms.JMSException;
import jakarta.jms.JMSException;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;

View File

@ -16,7 +16,7 @@
*/
package org.apache.activemq.ra;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
public class ActiveMQEndpointActivationKey {

View File

@ -19,21 +19,21 @@ package org.apache.activemq.ra;
import java.lang.reflect.Method;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Session;
import javax.jms.Topic;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionConsumer;
import jakarta.jms.ExceptionListener;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkManager;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkException;
import jakarta.resource.spi.work.WorkManager;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionConsumer;
@ -212,10 +212,10 @@ public class ActiveMQEndpointWorker {
}
}
else {
if ("javax.jms.Queue".equals(activationSpec.getDestinationType())) {
if ("jakarta.jms.Queue".equals(activationSpec.getDestinationType())) {
dest = new ActiveMQQueue(activationSpec.getDestination());
}
else if ("javax.jms.Topic".equals(activationSpec.getDestinationType())) {
else if ("jakarta.jms.Topic".equals(activationSpec.getDestinationType())) {
dest = new ActiveMQTopic(activationSpec.getDestination());
}
else {

View File

@ -19,16 +19,16 @@ package org.apache.activemq.ra;
import java.io.PrintWriter;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.jms.Connection;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.LocalTransaction;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionMetaData;
import jakarta.jms.Connection;
import jakarta.jms.ExceptionListener;
import jakarta.jms.JMSException;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionEvent;
import jakarta.resource.spi.ConnectionEventListener;
import jakarta.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.LocalTransaction;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionMetaData;
import javax.security.auth.Subject;
import javax.transaction.xa.XAResource;
import org.apache.activemq.ActiveMQConnection;

View File

@ -24,14 +24,14 @@ import java.io.Serializable;
import java.util.Iterator;
import java.util.Set;
import javax.jms.JMSException;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionManager;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.ResourceAdapterAssociation;
import jakarta.jms.JMSException;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionManager;
import jakarta.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import jakarta.resource.spi.ResourceAdapter;
import jakarta.resource.spi.ResourceAdapterAssociation;
import javax.security.auth.Subject;
import org.slf4j.LoggerFactory;

View File

@ -22,13 +22,13 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.JMSException;
import javax.resource.NotSupportedException;
import javax.resource.ResourceException;
import javax.resource.spi.ActivationSpec;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.ResourceAdapterInternalException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.jms.JMSException;
import jakarta.resource.NotSupportedException;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ActivationSpec;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.ResourceAdapterInternalException;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

View File

@ -16,20 +16,20 @@
*/
package org.apache.activemq.ra;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionMetaData;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueSession;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionConsumer;
import jakarta.jms.ConnectionMetaData;
import jakarta.jms.Destination;
import jakarta.jms.ExceptionListener;
import jakarta.jms.JMSException;
import jakarta.jms.Queue;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueSession;
import jakarta.jms.ServerSessionPool;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicSession;
import org.apache.activemq.ActiveMQConnectionMetaData;
@ -149,7 +149,7 @@ public class InboundConnectionProxy implements Connection, QueueConnection, Topi
/**
*
* @see javax.jms.ConnectionConsumer
* @see jakarta.jms.ConnectionConsumer
* @since 2.0
*/
@Override
@ -159,7 +159,7 @@ public class InboundConnectionProxy implements Connection, QueueConnection, Topi
/**
*
* @see javax.jms.ConnectionConsumer
* @see jakarta.jms.ConnectionConsumer
* @since 2.0
*/
@Override

View File

@ -16,14 +16,14 @@
*/
package org.apache.activemq.ra;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSContext;
import javax.jms.JMSException;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSContext;
import jakarta.jms.JMSException;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicConnectionFactory;
/**
* A {@link ConnectionFactory} implementation which creates connections which can

View File

@ -16,9 +16,9 @@
*/
package org.apache.activemq.ra;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import jakarta.jms.JMSException;
import jakarta.jms.MessageProducer;
import jakarta.jms.Session;
/**
* Represents an object which has-a {@link Session} instance and
@ -43,7 +43,7 @@ public interface InboundContext {
*
* @return the current message producer or a new one is lazily created, using a null
* destination so the destination must be specified on a send() method.
* @throws javax.jms.JMSException
* @throws jakarta.jms.JMSException
*/
MessageProducer getMessageProducer() throws JMSException;
}

View File

@ -16,20 +16,20 @@
*/
package org.apache.activemq.ra;
import javax.jms.CompletionListener;
import javax.jms.Destination;
import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.QueueSender;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import jakarta.jms.CompletionListener;
import jakarta.jms.Destination;
import jakarta.jms.InvalidDestinationException;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.QueueSender;
import jakarta.jms.Topic;
import jakarta.jms.TopicPublisher;
/**
* An implementation of {@link MessageProducer} which uses the ActiveMQ JCA ResourceAdapter's
* current thread's JMS {@link javax.jms.Session} to send messages.
* current thread's JMS {@link jakarta.jms.Session} to send messages.
*
*
*/
@ -172,7 +172,7 @@ public class InboundMessageProducerProxy implements MessageProducer, QueueSender
* specified.
* @throws InvalidDestinationException if a client uses this method with an
* invalid destination.
* @see javax.jms.Session#createProducer
* @see jakarta.jms.Session#createProducer
* @since 2.0
*/
@Override
@ -213,7 +213,7 @@ public class InboundMessageProducerProxy implements MessageProducer, QueueSender
* Gets the delivery delay value for this <CODE>MessageProducer</CODE>.
*
* @return the delivery delay for this messageProducer
* @throws javax.jms.JMSException if the JMS provider fails to determine if deliver delay is
* @throws jakarta.jms.JMSException if the JMS provider fails to determine if deliver delay is
* disabled due to some internal error.
*/
@Override

View File

@ -18,29 +18,29 @@ package org.apache.activemq.ra;
import java.io.Serializable;
import javax.jms.BytesMessage;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.StreamMessage;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import jakarta.jms.BytesMessage;
import jakarta.jms.Destination;
import jakarta.jms.JMSException;
import jakarta.jms.MapMessage;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.ObjectMessage;
import jakarta.jms.Queue;
import jakarta.jms.QueueBrowser;
import jakarta.jms.QueueReceiver;
import jakarta.jms.QueueSender;
import jakarta.jms.QueueSession;
import jakarta.jms.Session;
import jakarta.jms.StreamMessage;
import jakarta.jms.TemporaryQueue;
import jakarta.jms.TemporaryTopic;
import jakarta.jms.TextMessage;
import jakarta.jms.Topic;
import jakarta.jms.TopicPublisher;
import jakarta.jms.TopicSession;
import jakarta.jms.TopicSubscriber;
/**
* A {@link Session} implementation which can be used with the ActiveMQ JCA

View File

@ -16,9 +16,9 @@
*/
package org.apache.activemq.ra;
import javax.jms.JMSException;
import javax.resource.ResourceException;
import javax.resource.spi.LocalTransaction;
import jakarta.jms.JMSException;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.LocalTransaction;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

View File

@ -19,22 +19,22 @@ package org.apache.activemq.ra;
import java.util.ArrayList;
import java.util.List;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionMetaData;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.IllegalStateException;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueSession;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
import javax.resource.spi.ConnectionRequestInfo;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionConsumer;
import jakarta.jms.ConnectionMetaData;
import jakarta.jms.Destination;
import jakarta.jms.ExceptionListener;
import jakarta.jms.IllegalStateException;
import jakarta.jms.JMSException;
import jakarta.jms.Queue;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueSession;
import jakarta.jms.ServerSessionPool;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicSession;
import jakarta.resource.spi.ConnectionRequestInfo;
import org.apache.activemq.ActiveMQQueueSession;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.ActiveMQTopicSession;
@ -91,7 +91,7 @@ public class ManagedConnectionProxy implements Connection, QueueConnection, Topi
/**
* @return "physical" underlying activemq connection, if proxy is associated with a managed connection
* @throws javax.jms.JMSException if managed connection is null
* @throws jakarta.jms.JMSException if managed connection is null
*/
private Connection getConnection() throws JMSException {
if (managedConnection == null) {
@ -330,7 +330,7 @@ public class ManagedConnectionProxy implements Connection, QueueConnection, Topi
/**
*
* @see javax.jms.ConnectionConsumer
* @see jakarta.jms.ConnectionConsumer
* @since 2.0
*/
@Override
@ -340,7 +340,7 @@ public class ManagedConnectionProxy implements Connection, QueueConnection, Topi
/**
*
* @see javax.jms.ConnectionConsumer
* @see jakarta.jms.ConnectionConsumer
* @since 2.0
*/
@Override

View File

@ -18,30 +18,30 @@ package org.apache.activemq.ra;
import java.io.Serializable;
import javax.jms.BytesMessage;
import javax.jms.Destination;
import javax.jms.IllegalStateException;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.StreamMessage;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import jakarta.jms.BytesMessage;
import jakarta.jms.Destination;
import jakarta.jms.IllegalStateException;
import jakarta.jms.JMSException;
import jakarta.jms.MapMessage;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.ObjectMessage;
import jakarta.jms.Queue;
import jakarta.jms.QueueBrowser;
import jakarta.jms.QueueReceiver;
import jakarta.jms.QueueSender;
import jakarta.jms.QueueSession;
import jakarta.jms.Session;
import jakarta.jms.StreamMessage;
import jakarta.jms.TemporaryQueue;
import jakarta.jms.TemporaryTopic;
import jakarta.jms.TextMessage;
import jakarta.jms.Topic;
import jakarta.jms.TopicPublisher;
import jakarta.jms.TopicSession;
import jakarta.jms.TopicSubscriber;
import org.apache.activemq.ActiveMQSession;
@ -92,7 +92,7 @@ public class ManagedSessionProxy implements Session, QueueSession, TopicSession
/**
*
* @return underlying session, unless this proxy is closed
* @throws javax.jms.JMSException if session is closed
* @throws jakarta.jms.JMSException if session is closed
*/
private Session getSession() throws JMSException {
if (closed) {
@ -400,7 +400,7 @@ public class ManagedSessionProxy implements Session, QueueSession, TopicSession
}
/**
* @see javax.jms.Session#run()
* @see jakarta.jms.Session#run()
*/
public void run() {
throw new RuntimeException("Operation not supported.");

View File

@ -16,7 +16,7 @@
*/
package org.apache.activemq.ra;
import javax.jms.JMSException;
import jakarta.jms.JMSException;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

View File

@ -19,8 +19,8 @@ package org.apache.activemq.ra;
import org.apache.activemq.RedeliveryPolicy;
import javax.resource.spi.ResourceAdapter;
import javax.resource.spi.ActivationSpec;
import jakarta.resource.spi.ResourceAdapter;
import jakarta.resource.spi.ActivationSpec;
import java.util.List;
/**

View File

@ -18,10 +18,10 @@ package org.apache.activemq.ra;
import java.lang.reflect.Method;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpoint;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -17,9 +17,9 @@
package org.apache.activemq.ra;
import javax.jms.JMSException;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.ResourceAdapter;
import jakarta.jms.JMSException;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.ResourceAdapter;
import org.apache.activemq.ActiveMQConnection;

View File

@ -18,18 +18,18 @@ package org.apache.activemq.ra;
import java.lang.reflect.Method;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.ServerSession;
import javax.jms.Session;
import javax.resource.spi.endpoint.MessageEndpoint;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkEvent;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.ServerSession;
import jakarta.jms.Session;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkEvent;
import jakarta.resource.spi.work.WorkException;
import jakarta.resource.spi.work.WorkListener;
import jakarta.resource.spi.work.WorkManager;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.ActiveMQSession.DeliveryListener;
@ -115,7 +115,7 @@ public class ServerSessionImpl implements ServerSession, InboundContext, Work, D
}
/**
* @see javax.jms.ServerSession#start()
* @see jakarta.jms.ServerSession#start()
*/
public void start() throws JMSException {

View File

@ -23,12 +23,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.jms.JMSException;
import javax.jms.ServerSession;
import javax.jms.ServerSessionPool;
import javax.jms.Session;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.endpoint.MessageEndpoint;
import jakarta.jms.JMSException;
import jakarta.jms.ServerSession;
import jakarta.jms.ServerSessionPool;
import jakarta.jms.Session;
import jakarta.resource.spi.UnavailableException;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQSession;

View File

@ -16,13 +16,13 @@
*/
package org.apache.activemq.ra;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
import javax.resource.spi.ConnectionManager;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionEvent;
import jakarta.resource.spi.ConnectionEventListener;
import jakarta.resource.spi.ConnectionManager;
import jakarta.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import javax.security.auth.Subject;
import org.slf4j.Logger;

View File

@ -28,10 +28,10 @@ import java.beans.PropertyDescriptor;
import java.util.Arrays;
import java.util.List;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.Topic;
import javax.resource.spi.InvalidPropertyException;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import jakarta.resource.spi.InvalidPropertyException;
import org.apache.activemq.command.ActiveMQDestination;
import org.junit.Before;

View File

@ -26,9 +26,9 @@ import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import javax.jms.Connection;
import javax.jms.Session;
import javax.jms.TopicSubscriber;
import jakarta.jms.Connection;
import jakarta.jms.Session;
import jakarta.jms.TopicSubscriber;
import javax.transaction.xa.XAResource;
import org.apache.activemq.ActiveMQConnection;

View File

@ -16,8 +16,8 @@
*/
package org.apache.activemq.ra;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
import jakarta.resource.spi.ConnectionEvent;
import jakarta.resource.spi.ConnectionEventListener;
public class ConnectionEventListenerAdapter implements ConnectionEventListener {

View File

@ -19,13 +19,13 @@ package org.apache.activemq.ra;
import java.util.ArrayList;
import java.util.Iterator;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import javax.resource.spi.ConnectionEventListener;
import javax.resource.spi.ConnectionManager;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionEvent;
import jakarta.resource.spi.ConnectionEventListener;
import jakarta.resource.spi.ConnectionManager;
import jakarta.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import javax.security.auth.Subject;
import org.slf4j.Logger;

View File

@ -26,23 +26,26 @@ import java.util.Timer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.resource.ResourceException;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.endpoint.MessageEndpoint;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.ExecutionContext;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import jakarta.jms.Connection;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.UnavailableException;
import jakarta.resource.spi.XATerminator;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.work.ExecutionContext;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkContext;
import jakarta.resource.spi.work.WorkException;
import jakarta.resource.spi.work.WorkListener;
import jakarta.resource.spi.work.WorkManager;
import jakarta.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@ -166,6 +169,24 @@ public class FailoverManagedClusterTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -239,6 +260,18 @@ public class FailoverManagedClusterTest {
public Timer createTimer() throws UnavailableException {
return null;
}
@Override
public boolean isContextSupported(Class<? extends WorkContext> workContextClass) {
// TODO Auto-generated method stub
return false;
}
@Override
public TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() {
// TODO Auto-generated method stub
return null;
}
}
public class StubMessageEndpoint implements MessageEndpoint, MessageListener {

View File

@ -18,7 +18,7 @@ package org.apache.activemq.ra;
import java.util.HashSet;
import javax.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerService;

View File

@ -21,13 +21,14 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.resource.spi.ManagedConnection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageProducer;
import jakarta.jms.Session;
import jakarta.resource.spi.ManagedConnection;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@ -37,6 +38,7 @@ import org.apache.activemq.ActiveMQPrefetchPolicy;
import org.apache.activemq.JmsQueueTransactionTest;
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.util.ClassLoadingAwareObjectInputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -50,7 +52,7 @@ public class JmsXAQueueTransactionTest extends JmsQueueTransactionTest {
@Override
protected void setUp() throws Exception {
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.util");
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.lang,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper");
super.setUp();
}
@ -78,7 +80,7 @@ public class JmsXAQueueTransactionTest extends JmsQueueTransactionTest {
/**
* Recreates the connection.
*
* @throws javax.jms.JMSException
* @throws jakarta.jms.JMSException
*/
@Override
protected void reconnect() throws Exception {

View File

@ -21,11 +21,11 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.net.URI;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Session;
import javax.resource.ResourceException;
import javax.resource.spi.ManagedConnection;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.Session;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ManagedConnection;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@ -59,7 +59,7 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
@Override
protected void setUp() throws Exception {
LOG.info("Starting ----------------------------> {}", this.getName());
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.util");
System.setProperty("org.apache.activemq.SERIALIZABLE_PACKAGES", "java.lang,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper");
super.setUp();
}
@ -103,7 +103,7 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
/**
* Recreates the connection.
*
* @throws javax.jms.JMSException
* @throws jakarta.jms.JMSException
*/
@Override
protected void reconnect() throws Exception {

View File

@ -36,25 +36,28 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.resource.ResourceException;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.endpoint.MessageEndpoint;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.ExecutionContext;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import jakarta.jms.Connection;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.UnavailableException;
import jakarta.resource.spi.XATerminator;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.work.ExecutionContext;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkContext;
import jakarta.resource.spi.work.WorkException;
import jakarta.resource.spi.work.WorkListener;
import jakarta.resource.spi.work.WorkManager;
import jakarta.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@ -132,6 +135,18 @@ public class MDBTest {
public Timer createTimer() throws UnavailableException {
return null;
}
@Override
public boolean isContextSupported(Class<? extends WorkContext> workContextClass) {
// TODO Auto-generated method stub
return false;
}
@Override
public TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() {
// TODO Auto-generated method stub
return null;
}
}
public class StubMessageEndpoint implements MessageEndpoint, MessageListener {
@ -218,6 +233,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -286,6 +319,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -363,6 +414,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return false;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -427,6 +496,25 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout)
throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -540,6 +628,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -653,6 +759,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -745,6 +869,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -849,6 +991,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -923,6 +1083,24 @@ public class MDBTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint

View File

@ -31,17 +31,17 @@ import java.io.PrintWriter;
import java.io.Serializable;
import java.util.HashSet;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.QueueConnectionFactory;
import javax.jms.Session;
import javax.jms.TopicConnectionFactory;
import javax.resource.Referenceable;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.resource.spi.ManagedConnectionFactory;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.Session;
import jakarta.jms.TopicConnectionFactory;
import jakarta.resource.Referenceable;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionRequestInfo;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.junit.Before;

View File

@ -21,17 +21,17 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.Session;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEvent;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.Session;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicConnectionFactory;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.ConnectionEvent;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;

View File

@ -21,18 +21,20 @@ import static org.junit.Assert.fail;
import java.lang.reflect.Method;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpoint;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JMock;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@Ignore
@RunWith(JMock.class)
public class MessageEndpointProxyTest {

View File

@ -16,10 +16,10 @@
*/
package org.apache.activemq.ra;
import javax.jms.ConnectionFactory;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import javax.net.ssl.KeyManager;
import javax.net.ssl.TrustManager;

View File

@ -31,30 +31,33 @@ import java.util.Timer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import jakarta.jms.Connection;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.MessageListener;
import jakarta.jms.MessageProducer;
import jakarta.jms.Queue;
import jakarta.jms.Session;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.resource.ResourceException;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.UnavailableException;
import javax.resource.spi.XATerminator;
import javax.resource.spi.endpoint.MessageEndpoint;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.ExecutionContext;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.UnavailableException;
import jakarta.resource.spi.XATerminator;
import jakarta.resource.spi.endpoint.MessageEndpoint;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.work.ExecutionContext;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkContext;
import jakarta.resource.spi.work.WorkException;
import jakarta.resource.spi.work.WorkListener;
import jakarta.resource.spi.work.WorkManager;
import jakarta.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@ -164,6 +167,18 @@ public class SSLTest {
public Timer createTimer() throws UnavailableException {
return null;
}
@Override
public boolean isContextSupported(Class<? extends WorkContext> workContextClass) {
// TODO Auto-generated method stub
return false;
}
@Override
public TransactionSynchronizationRegistry getTransactionSynchronizationRegistry() {
// TODO Auto-generated method stub
return null;
}
}
public class StubMessageEndpoint implements MessageEndpoint, MessageListener {
@ -252,6 +267,24 @@ public class SSLTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -330,6 +363,24 @@ public class SSLTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint
@ -408,6 +459,24 @@ public class SSLTest {
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
@Override
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActivationName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Class<?> getEndpointClass() {
// TODO Auto-generated method stub
return null;
}
};
// Activate an Endpoint

View File

@ -31,23 +31,24 @@ import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.api.Action;
import org.jmock.api.Invocation;
import org.jmock.imposters.ByteBuddyClassImposteriser;
import org.jmock.integration.junit4.JMock;
import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.jms.JMSException;
import javax.jms.Session;
import javax.resource.spi.BootstrapContext;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.ExecutionContext;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import jakarta.jms.JMSException;
import jakarta.jms.Session;
import jakarta.resource.spi.BootstrapContext;
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
import jakarta.resource.spi.work.ExecutionContext;
import jakarta.resource.spi.work.Work;
import jakarta.resource.spi.work.WorkListener;
import jakarta.resource.spi.work.WorkManager;
import javax.transaction.xa.XAResource;
import java.lang.reflect.Method;
import java.util.concurrent.CountDownLatch;
@ -60,6 +61,7 @@ import java.util.concurrent.atomic.AtomicReference;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@Ignore
@RunWith(JMock.class)
public class ServerSessionImplTest {
@ -79,7 +81,7 @@ public class ServerSessionImplTest {
public void setUp() throws Exception {
context = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
setImposteriser(ByteBuddyClassImposteriser.INSTANCE);
}
};
@ -142,7 +144,7 @@ public class ServerSessionImplTest {
allowing(messageActivationSpec).isUseJndi();
will(returnValue(Boolean.FALSE));
allowing(messageActivationSpec).getDestinationType();
will(returnValue("javax.jms.Queue"));
will(returnValue("jakarta.jms.Queue"));
allowing(messageActivationSpec).getDestination();
will(returnValue("Queue"));
allowing(messageActivationSpec).getAcknowledgeModeForSession();
@ -156,7 +158,7 @@ public class ServerSessionImplTest {
allowing(messageEndpointFactory).createEndpoint(with(any(XAResource.class)));
will(returnValue(messageEndpoint));
allowing(workManager).scheduleWork((Work) with(Matchers.instanceOf(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
allowing(workManager).scheduleWork((Work) with(any(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
with(any(WorkListener.class)));
will(new Action() {
@Override
@ -169,8 +171,8 @@ public class ServerSessionImplTest {
}
});
allowing(messageEndpoint).beforeDelivery((Method) with(Matchers.instanceOf(Method.class)));
allowing(messageEndpoint).onMessage(with(any(javax.jms.Message.class)));
allowing(messageEndpoint).beforeDelivery((Method) with(any(Method.class)));
allowing(messageEndpoint).onMessage(with(any(jakarta.jms.Message.class)));
will(new Action() {
@Override
public Object invoke(Invocation invocation) throws Throwable {
@ -270,7 +272,7 @@ public class ServerSessionImplTest {
allowing(messageActivationSpec).isUseJndi();
will(returnValue(Boolean.FALSE));
allowing(messageActivationSpec).getDestinationType();
will(returnValue("javax.jms.Queue"));
will(returnValue("jakarta.jms.Queue"));
allowing(messageActivationSpec).getDestination();
will(returnValue("Queue"));
allowing(messageActivationSpec).getAcknowledgeModeForSession();
@ -284,7 +286,7 @@ public class ServerSessionImplTest {
allowing(messageEndpointFactory).createEndpoint(with(any(XAResource.class)));
will(returnValue(messageEndpoint));
allowing(workManager).scheduleWork((Work) with(Matchers.instanceOf(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
allowing(workManager).scheduleWork((Work) with(any(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
with(any(WorkListener.class)));
will(new Action() {
@Override
@ -313,8 +315,8 @@ public class ServerSessionImplTest {
}
});
allowing(messageEndpoint).beforeDelivery((Method) with(Matchers.instanceOf(Method.class)));
allowing(messageEndpoint).onMessage(with(any(javax.jms.Message.class)));
allowing(messageEndpoint).beforeDelivery((Method) with(any(Method.class)));
allowing(messageEndpoint).onMessage(with(any(jakarta.jms.Message.class)));
will(new Action() {
@Override
public Object invoke(Invocation invocation) throws Throwable {
@ -461,7 +463,7 @@ public class ServerSessionImplTest {
allowing(messageActivationSpec).isUseJndi();
will(returnValue(Boolean.FALSE));
allowing(messageActivationSpec).getDestinationType();
will(returnValue("javax.jms.Queue"));
will(returnValue("jakarta.jms.Queue"));
allowing(messageActivationSpec).getDestination();
will(returnValue("Queue"));
allowing(messageActivationSpec).getAcknowledgeModeForSession();
@ -475,7 +477,7 @@ public class ServerSessionImplTest {
allowing(messageEndpointFactory).createEndpoint(with(any(XAResource.class)));
will(returnValue(messageEndpoint));
allowing(workManager).scheduleWork((Work) with(Matchers.instanceOf(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
allowing(workManager).scheduleWork((Work) with(any(Work.class)), with(any(long.class)), with(any(ExecutionContext.class)),
with(any(WorkListener.class)));
allowing(messageEndpoint).release();
}

View File

@ -18,14 +18,14 @@ package org.apache.activemq.ra;
import static org.junit.Assert.assertNotNull;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
import javax.resource.ResourceException;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageProducer;
import jakarta.jms.Session;
import jakarta.jms.Topic;
import jakarta.jms.TopicSubscriber;
import jakarta.resource.ResourceException;
import javax.transaction.xa.XAException;
import org.apache.activemq.ActiveMQConnectionFactory;

View File

@ -42,8 +42,8 @@
<artifactId>jakarta.jms-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
<groupId>jakarta.resource</groupId>
<artifactId>jakarta.resource-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@ -164,8 +164,8 @@
<artifactId>jakarta.jms-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
<groupId>jakarta.resource</groupId>
<artifactId>jakarta.resource-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>