com.github.smokestack.jms
Class MockSession

java.lang.Object
  extended by com.github.smokestack.jms.MockSession
All Implemented Interfaces:
Runnable, Session

public class MockSession
extends Object
implements Session

Author:
gliptak

Nested Class Summary
static class MockSession.SessionState
           
static class MockSession.TransactionState
           
 
Field Summary
protected  int acknowledgeMode
           
protected  List<MockMessageConsumer> mockMessageConsumers
           
protected  List<MockMessageProducer> mockMessageProducers
           
protected  List<MockMessage> mockMessages
           
protected  List<MockQueueBrowser> mockQueueBrowsers
           
protected  MockSession.SessionState mockSessionState
           
 MockSession.TransactionState mockTransactionState
           
protected  boolean transacted
           
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Constructor Summary
MockSession(boolean transacted, int acknowledgeMode)
           
 
Method Summary
 void _close()
           
 void _commit()
           
 QueueBrowser _createBrowser(Queue queue)
           
 QueueBrowser _createBrowser(Queue queue, String messageSelector)
           
 BytesMessage _createBytesMessage()
           
 MessageConsumer _createConsumer(Destination destination)
           
 MessageConsumer _createConsumer(Destination destination, String messageSelector)
           
 MessageConsumer _createConsumer(Destination destination, String messageSelector, boolean NoLocal)
           
 TopicSubscriber _createDurableSubscriber(Topic topic, String name)
           
 TopicSubscriber _createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
           
 MapMessage _createMapMessage()
           
 Message _createMessage()
           
 ObjectMessage _createObjectMessage()
           
 ObjectMessage _createObjectMessage(Serializable arg0)
           
 MessageProducer _createProducer(Destination destination)
           
 Queue _createQueue(String arg0)
           
 StreamMessage _createStreamMessage()
           
 TemporaryQueue _createTemporaryQueue()
           
 TemporaryTopic _createTemporaryTopic()
           
 TextMessage _createTextMessage()
           
 TextMessage _createTextMessage(String text)
           
 Topic _createTopic(String arg0)
           
 int _getAcknowledgeMode()
           
 MessageListener _getMessageListener()
           
 boolean _getTransacted()
           
 void _recover()
           
 void _rollback()
           
 void _run()
           
 void _setMessageListener(MessageListener messageListener)
           
 void _unsubscribe(String arg0)
           
 void assertMockCommit()
          Validation
 void assertMockComplete()
          Validation
 void assertMockRollback()
          Validation
 void close()
           
 void commit()
           
 QueueBrowser createBrowser(Queue queue)
           
 QueueBrowser createBrowser(Queue queue, String messageSelector)
           
 BytesMessage createBytesMessage()
           
 MessageConsumer createConsumer(Destination destination)
           
 MessageConsumer createConsumer(Destination destination, String messageSelector)
           
 MessageConsumer createConsumer(Destination destination, String messageSelector, boolean NoLocal)
           
 TopicSubscriber createDurableSubscriber(Topic topic, String name)
           
 TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
           
 MapMessage createMapMessage()
           
 Message createMessage()
           
 ObjectMessage createObjectMessage()
           
 ObjectMessage createObjectMessage(Serializable arg0)
           
 MessageProducer createProducer(Destination destination)
           
 Queue createQueue(String arg0)
           
 StreamMessage createStreamMessage()
           
 TemporaryQueue createTemporaryQueue()
           
 TemporaryTopic createTemporaryTopic()
           
 TextMessage createTextMessage()
           
 TextMessage createTextMessage(String text)
           
 Topic createTopic(String arg0)
           
 int getAcknowledgeMode()
           
 MessageListener getMessageListener()
           
 List<MockMessageConsumer> getMockMessageConsumers()
           
 List<MockMessageProducer> getMockMessageProducers()
           
 List<MockMessage> getMockMessages()
           
 boolean getTransacted()
           
 void recover()
           
 void rollback()
           
 void run()
           
 void setMessageListener(MessageListener messageListener)
           
 String toString()
           
 void unsubscribe(String arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transacted

protected boolean transacted

acknowledgeMode

protected int acknowledgeMode

mockSessionState

protected MockSession.SessionState mockSessionState

mockTransactionState

public MockSession.TransactionState mockTransactionState

mockMessageProducers

protected List<MockMessageProducer> mockMessageProducers

mockMessageConsumers

protected List<MockMessageConsumer> mockMessageConsumers

mockQueueBrowsers

protected List<MockQueueBrowser> mockQueueBrowsers

mockMessages

protected List<MockMessage> mockMessages
Constructor Detail

MockSession

public MockSession(boolean transacted,
                   int acknowledgeMode)
Method Detail

close

public void close()
           throws JMSException
Specified by:
close in interface Session
Throws:
JMSException

_close

public void _close()
            throws JMSException
Throws:
JMSException

commit

public void commit()
            throws JMSException
Specified by:
commit in interface Session
Throws:
JMSException

_commit

public void _commit()
             throws JMSException
Throws:
JMSException

createBrowser

public QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Specified by:
createBrowser in interface Session
Throws:
JMSException

_createBrowser

public QueueBrowser _createBrowser(Queue queue)
                            throws JMSException
Throws:
JMSException

createBrowser

public QueueBrowser createBrowser(Queue queue,
                                  String messageSelector)
                           throws JMSException
Specified by:
createBrowser in interface Session
Throws:
JMSException

_createBrowser

public QueueBrowser _createBrowser(Queue queue,
                                   String messageSelector)
                            throws JMSException
Throws:
JMSException

createBytesMessage

public BytesMessage createBytesMessage()
                                throws JMSException
Specified by:
createBytesMessage in interface Session
Throws:
JMSException

_createBytesMessage

public BytesMessage _createBytesMessage()
                                 throws JMSException
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

_createConsumer

public MessageConsumer _createConsumer(Destination destination)
                                throws JMSException
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination,
                                      String messageSelector)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

_createConsumer

public MessageConsumer _createConsumer(Destination destination,
                                       String messageSelector)
                                throws JMSException
Throws:
JMSException

createConsumer

public MessageConsumer createConsumer(Destination destination,
                                      String messageSelector,
                                      boolean NoLocal)
                               throws JMSException
Specified by:
createConsumer in interface Session
Throws:
JMSException

_createConsumer

public MessageConsumer _createConsumer(Destination destination,
                                       String messageSelector,
                                       boolean NoLocal)
                                throws JMSException
Throws:
JMSException

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String name)
                                        throws JMSException
Specified by:
createDurableSubscriber in interface Session
Throws:
JMSException

_createDurableSubscriber

public TopicSubscriber _createDurableSubscriber(Topic topic,
                                                String name)
                                         throws JMSException
Throws:
JMSException

createDurableSubscriber

public TopicSubscriber createDurableSubscriber(Topic topic,
                                               String name,
                                               String messageSelector,
                                               boolean noLocal)
                                        throws JMSException
Specified by:
createDurableSubscriber in interface Session
Throws:
JMSException

_createDurableSubscriber

public TopicSubscriber _createDurableSubscriber(Topic topic,
                                                String name,
                                                String messageSelector,
                                                boolean noLocal)
                                         throws JMSException
Throws:
JMSException

createMapMessage

public MapMessage createMapMessage()
                            throws JMSException
Specified by:
createMapMessage in interface Session
Throws:
JMSException

_createMapMessage

public MapMessage _createMapMessage()
                             throws JMSException
Throws:
JMSException

createMessage

public Message createMessage()
                      throws JMSException
Specified by:
createMessage in interface Session
Throws:
JMSException

_createMessage

public Message _createMessage()
                       throws JMSException
Throws:
JMSException

createObjectMessage

public ObjectMessage createObjectMessage()
                                  throws JMSException
Specified by:
createObjectMessage in interface Session
Throws:
JMSException

_createObjectMessage

public ObjectMessage _createObjectMessage()
                                   throws JMSException
Throws:
JMSException

createObjectMessage

public ObjectMessage createObjectMessage(Serializable arg0)
                                  throws JMSException
Specified by:
createObjectMessage in interface Session
Throws:
JMSException

_createObjectMessage

public ObjectMessage _createObjectMessage(Serializable arg0)
                                   throws JMSException
Throws:
JMSException

createProducer

public MessageProducer createProducer(Destination destination)
                               throws JMSException
Specified by:
createProducer in interface Session
Throws:
JMSException

_createProducer

public MessageProducer _createProducer(Destination destination)
                                throws JMSException
Throws:
JMSException

createQueue

public Queue createQueue(String arg0)
                  throws JMSException
Specified by:
createQueue in interface Session
Throws:
JMSException

_createQueue

public Queue _createQueue(String arg0)
                   throws JMSException
Throws:
JMSException

createStreamMessage

public StreamMessage createStreamMessage()
                                  throws JMSException
Specified by:
createStreamMessage in interface Session
Throws:
JMSException

_createStreamMessage

public StreamMessage _createStreamMessage()
                                   throws JMSException
Throws:
JMSException

createTemporaryQueue

public TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Specified by:
createTemporaryQueue in interface Session
Throws:
JMSException

_createTemporaryQueue

public TemporaryQueue _createTemporaryQueue()
                                     throws JMSException
Throws:
JMSException

createTemporaryTopic

public TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Specified by:
createTemporaryTopic in interface Session
Throws:
JMSException

_createTemporaryTopic

public TemporaryTopic _createTemporaryTopic()
                                     throws JMSException
Throws:
JMSException

createTextMessage

public TextMessage createTextMessage()
                              throws JMSException
Specified by:
createTextMessage in interface Session
Throws:
JMSException

_createTextMessage

public TextMessage _createTextMessage()
                               throws JMSException
Throws:
JMSException

createTextMessage

public TextMessage createTextMessage(String text)
                              throws JMSException
Specified by:
createTextMessage in interface Session
Throws:
JMSException

_createTextMessage

public TextMessage _createTextMessage(String text)
                               throws JMSException
Throws:
JMSException

createTopic

public Topic createTopic(String arg0)
                  throws JMSException
Specified by:
createTopic in interface Session
Throws:
JMSException

_createTopic

public Topic _createTopic(String arg0)
                   throws JMSException
Throws:
JMSException

getAcknowledgeMode

public int getAcknowledgeMode()
                       throws JMSException
Specified by:
getAcknowledgeMode in interface Session
Throws:
JMSException

_getAcknowledgeMode

public int _getAcknowledgeMode()
                        throws JMSException
Throws:
JMSException

getMessageListener

public MessageListener getMessageListener()
                                   throws JMSException
Specified by:
getMessageListener in interface Session
Throws:
JMSException

_getMessageListener

public MessageListener _getMessageListener()
                                    throws JMSException
Throws:
JMSException

getTransacted

public boolean getTransacted()
                      throws JMSException
Specified by:
getTransacted in interface Session
Throws:
JMSException

_getTransacted

public boolean _getTransacted()
                       throws JMSException
Throws:
JMSException

recover

public void recover()
             throws JMSException
Specified by:
recover in interface Session
Throws:
JMSException

_recover

public void _recover()
              throws JMSException
Throws:
JMSException

rollback

public void rollback()
              throws JMSException
Specified by:
rollback in interface Session
Throws:
JMSException

_rollback

public void _rollback()
               throws JMSException
Throws:
JMSException

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in interface Session

_run

public void _run()

setMessageListener

public void setMessageListener(MessageListener messageListener)
                        throws JMSException
Specified by:
setMessageListener in interface Session
Throws:
JMSException

_setMessageListener

public void _setMessageListener(MessageListener messageListener)
                         throws JMSException
Throws:
JMSException

unsubscribe

public void unsubscribe(String arg0)
                 throws JMSException
Specified by:
unsubscribe in interface Session
Throws:
JMSException

_unsubscribe

public void _unsubscribe(String arg0)
                  throws JMSException
Throws:
JMSException

assertMockComplete

public void assertMockComplete()
Validation


assertMockCommit

public void assertMockCommit()
Validation


assertMockRollback

public void assertMockRollback()
Validation


getMockMessageProducers

public List<MockMessageProducer> getMockMessageProducers()
Returns:
the mockMessageProducers

getMockMessageConsumers

public List<MockMessageConsumer> getMockMessageConsumers()
Returns:
the mockMessageConsumers

getMockMessages

public List<MockMessage> getMockMessages()
Returns:
the mockMessages

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 Smokestack. All Rights Reserved.