Package org.apache.activemq.junit
Class AbstractActiveMQConsumerResource
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.apache.activemq.junit.AbstractActiveMQClientResource
-
- org.apache.activemq.junit.AbstractActiveMQConsumerResource
-
- All Implemented Interfaces:
org.junit.rules.TestRule
- Direct Known Subclasses:
ActiveMQQueueReceiverResource
,ActiveMQTopicDurableSubscriberResource
,ActiveMQTopicSubscriberResource
public abstract class AbstractActiveMQConsumerResource extends AbstractActiveMQClientResource
-
-
Constructor Summary
Constructors Constructor Description AbstractActiveMQConsumerResource(String destinationName, URI brokerURI)
AbstractActiveMQConsumerResource(String destinationName, URI brokerURI, String userName, String password)
AbstractActiveMQConsumerResource(String destinationName, ActiveMQConnectionFactory connectionFactory)
AbstractActiveMQConsumerResource(String destinationName, EmbeddedActiveMQBroker embeddedActiveMQBroker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createClient()
long
getDefaultReceiveTimout()
BytesMessage
receiveBytesMessage()
BytesMessage
receiveBytesMessage(long timeout)
MapMessage
receiveMapMessage()
MapMessage
receiveMapMessage(long timeout)
Message
receiveMessage()
Message
receiveMessage(long timeout)
Receive a message with the given timeoutObjectMessage
receiveObjectMessage()
ObjectMessage
receiveObjectMessage(long timeout)
TextMessage
receiveTextMessage()
TextMessage
receiveTextMessage(long timeout)
void
setDefaultReceiveTimout(long defaultReceiveTimout)
-
Methods inherited from class org.apache.activemq.junit.AbstractActiveMQClientResource
after, before, createBytesMessage, createDestination, createMapMessage, createMessage, createMessage, createMessage, createMessage, createMessage, createMessage, createMessage, createMessage, createObjectMessage, createStreamMessage, createTextMessage, getBrokerURL, getClientId, getDestinationName, getDestinationType, setMessageProperties, start, stop
-
-
-
-
Constructor Detail
-
AbstractActiveMQConsumerResource
public AbstractActiveMQConsumerResource(String destinationName, ActiveMQConnectionFactory connectionFactory)
-
AbstractActiveMQConsumerResource
public AbstractActiveMQConsumerResource(String destinationName, URI brokerURI)
-
AbstractActiveMQConsumerResource
public AbstractActiveMQConsumerResource(String destinationName, EmbeddedActiveMQBroker embeddedActiveMQBroker)
-
-
Method Detail
-
getDefaultReceiveTimout
public long getDefaultReceiveTimout()
-
setDefaultReceiveTimout
public void setDefaultReceiveTimout(long defaultReceiveTimout)
-
createClient
protected void createClient() throws JMSException
- Specified by:
createClient
in classAbstractActiveMQClientResource
- Throws:
JMSException
-
receiveBytesMessage
public BytesMessage receiveBytesMessage() throws JMSException
- Throws:
JMSException
-
receiveTextMessage
public TextMessage receiveTextMessage() throws JMSException
- Throws:
JMSException
-
receiveMapMessage
public MapMessage receiveMapMessage() throws JMSException
- Throws:
JMSException
-
receiveObjectMessage
public ObjectMessage receiveObjectMessage() throws JMSException
- Throws:
JMSException
-
receiveBytesMessage
public BytesMessage receiveBytesMessage(long timeout) throws JMSException
- Throws:
JMSException
-
receiveTextMessage
public TextMessage receiveTextMessage(long timeout) throws JMSException
- Throws:
JMSException
-
receiveMapMessage
public MapMessage receiveMapMessage(long timeout) throws JMSException
- Throws:
JMSException
-
receiveObjectMessage
public ObjectMessage receiveObjectMessage(long timeout) throws JMSException
- Throws:
JMSException
-
receiveMessage
public Message receiveMessage() throws JMSException
- Throws:
JMSException
-
receiveMessage
public Message receiveMessage(long timeout) throws JMSException
Receive a message with the given timeout- Parameters:
timeout
-- Returns:
- Throws:
JMSException
-
-