com.mockrunner.mock.jms.MockQueueSession Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Mockrunner is a lightweight framework for unit testing applications
in the J2EE environment. It supports servlets, filters, tag classes
and Struts actions. It includes a JDBC a JMS and a JCA test
framework and can be used to test EJB based applications.
The newest version!
package com.mockrunner.mock.jms;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
/**
* Mock implementation of JMS QueueSession
.
*/
public class MockQueueSession extends MockSession implements QueueSession
{
public MockQueueSession(MockQueueConnection connection)
{
this(connection, false, Session.AUTO_ACKNOWLEDGE);
}
public MockQueueSession(MockQueueConnection connection, boolean transacted, int acknowledgeMode)
{
super(connection, transacted, acknowledgeMode);
}
public QueueReceiver createReceiver(Queue queue) throws JMSException
{
return (QueueReceiver)createConsumer(queue);
}
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
{
return (QueueReceiver)createConsumer(queue, messageSelector);
}
public QueueSender createSender(Queue queue) throws JMSException
{
return (QueueSender)createProducer(queue);
}
protected MessageProducer createProducerForNullDestination()
{
return getGenericTransmissionManager().createQueueSender();
}
}