java.lang.Object
com.mockobjects.MockObject
com.mockobjects.jms.MockSession
- All Implemented Interfaces:
- java.lang.Runnable, javax.jms.Session, com.mockobjects.Verifiable
- Direct Known Subclasses:
- MockQueueSession, MockTopicSession
- public class MockSession
- extends com.mockobjects.MockObject
- implements javax.jms.Session
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jms.Session |
createBrowser, createBrowser, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createProducer, createQueue, createTemporaryQueue, createTemporaryTopic, createTopic, getAcknowledgeMode, unsubscribe |
myCloseCalls
protected com.mockobjects.ExpectationCounter myCloseCalls
myCreateTextMessageCalls
protected com.mockobjects.ExpectationCounter myCreateTextMessageCalls
myTextMessage
private javax.jms.TextMessage myTextMessage
myException
private javax.jms.JMSException myException
objectMessageToReturn
private javax.jms.ObjectMessage objectMessageToReturn
MockSession
public MockSession()
setupCreateObjectMessage
public void setupCreateObjectMessage(javax.jms.ObjectMessage objectMessageToReturn)
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage()
throws javax.jms.JMSException
- Specified by:
createObjectMessage in interface javax.jms.Session
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
throws javax.jms.JMSException
- Specified by:
createObjectMessage in interface javax.jms.Session
rollback
public void rollback()
throws javax.jms.JMSException
- Specified by:
rollback in interface javax.jms.Session
setupTextMessage
public void setupTextMessage(javax.jms.TextMessage textMessage)
createBytesMessage
public javax.jms.BytesMessage createBytesMessage()
throws javax.jms.JMSException
- Specified by:
createBytesMessage in interface javax.jms.Session
createMapMessage
public javax.jms.MapMessage createMapMessage()
throws javax.jms.JMSException
- Specified by:
createMapMessage in interface javax.jms.Session
createMessage
public javax.jms.Message createMessage()
throws javax.jms.JMSException
- Specified by:
createMessage in interface javax.jms.Session
getTransacted
public boolean getTransacted()
throws javax.jms.JMSException
- Specified by:
getTransacted in interface javax.jms.Session
recover
public void recover()
throws javax.jms.JMSException
- Specified by:
recover in interface javax.jms.Session
close
public void close()
throws javax.jms.JMSException
- Specified by:
close in interface javax.jms.Session
commit
public void commit()
throws javax.jms.JMSException
- Specified by:
commit in interface javax.jms.Session
setMessageListener
public void setMessageListener(javax.jms.MessageListener listener)
throws javax.jms.JMSException
- Specified by:
setMessageListener in interface javax.jms.Session
setExpectedCloseCalls
public void setExpectedCloseCalls(int callCount)
setExpectedCreateTextMessageCalls
public void setExpectedCreateTextMessageCalls(int callCount)
createStreamMessage
public javax.jms.StreamMessage createStreamMessage()
throws javax.jms.JMSException
- Specified by:
createStreamMessage in interface javax.jms.Session
createTextMessage
public javax.jms.TextMessage createTextMessage()
throws javax.jms.JMSException
- Specified by:
createTextMessage in interface javax.jms.Session
createTextMessage
public javax.jms.TextMessage createTextMessage(java.lang.String text)
throws javax.jms.JMSException
- Specified by:
createTextMessage in interface javax.jms.Session
getMessageListener
public javax.jms.MessageListener getMessageListener()
throws javax.jms.JMSException
- Specified by:
getMessageListener in interface javax.jms.Session
run
public void run()
- Description copied from interface:
java.lang.Runnable
- This method will be called by whoever wishes to run your class
implementing Runnable. Note that there are no restrictions on what
you are allowed to do in the run method, except that you cannot
throw a checked exception.
- Specified by:
run in interface javax.jms.Session
setupThrowException
public void setupThrowException(javax.jms.JMSException e)
throwExceptionIfAny
protected void throwExceptionIfAny()
throws javax.jms.JMSException