com.mockrunner.mock.jms.MockTopicSession 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.Session;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
/**
* Mock implementation of JMS TopicSession
.
*/
public class MockTopicSession extends MockSession implements TopicSession
{
public MockTopicSession(MockTopicConnection connection)
{
this(connection, false, Session.AUTO_ACKNOWLEDGE);
}
public MockTopicSession(MockTopicConnection connection, boolean transacted, int acknowledgeMode)
{
super(connection, transacted, acknowledgeMode);
}
public TopicPublisher createPublisher(Topic topic) throws JMSException
{
return (TopicPublisher)createProducer(topic);
}
public TopicSubscriber createSubscriber(Topic topic) throws JMSException
{
return (TopicSubscriber)createConsumer(topic);
}
public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
{
return (TopicSubscriber)createConsumer(topic, messageSelector, noLocal);
}
protected MessageProducer createProducerForNullDestination()
{
return getGenericTransmissionManager().createTopicPublisher();
}
}