Package org.apache.activemq.junit
Class AbstractActiveMQClientResource
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.apache.activemq.junit.AbstractActiveMQClientResource
-
- All Implemented Interfaces:
org.junit.rules.TestRule
- Direct Known Subclasses:
AbstractActiveMQConsumerResource,AbstractActiveMQProducerResource
public abstract class AbstractActiveMQClientResource extends org.junit.rules.ExternalResource
-
-
Constructor Summary
Constructors Constructor Description AbstractActiveMQClientResource(String destinationName, URI brokerURI)AbstractActiveMQClientResource(String destinationName, URI brokerURI, String userName, String password)AbstractActiveMQClientResource(String destinationName, ActiveMQConnectionFactory connectionFactory)AbstractActiveMQClientResource(String destinationName, EmbeddedActiveMQBroker embeddedActiveMQBroker)AbstractActiveMQClientResource(URI brokerURI)AbstractActiveMQClientResource(URI brokerURI, String userName, String password)AbstractActiveMQClientResource(ActiveMQConnectionFactory connectionFactory)AbstractActiveMQClientResource(EmbeddedActiveMQBroker embeddedActiveMQBroker)
-
Method Summary
-
-
-
Constructor Detail
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(ActiveMQConnectionFactory connectionFactory)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(URI brokerURI)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(EmbeddedActiveMQBroker embeddedActiveMQBroker)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(URI brokerURI, String userName, String password)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(String destinationName, ActiveMQConnectionFactory connectionFactory)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(String destinationName, URI brokerURI)
-
AbstractActiveMQClientResource
public AbstractActiveMQClientResource(String destinationName, EmbeddedActiveMQBroker embeddedActiveMQBroker)
-
-
Method Detail
-
setMessageProperties
public static void setMessageProperties(Message message, Map<String,Object> properties) throws JMSException
- Throws:
JMSException
-
getClientId
public String getClientId()
-
getDestinationName
public String getDestinationName()
-
getDestinationType
public abstract byte getDestinationType()
-
createClient
protected abstract void createClient() throws JMSException- Throws:
JMSException
-
before
protected void before() throws ThrowableStart the Client Invoked by JUnit to setup the resource- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()
Stop the Client Invoked by JUnit to tear down the resource- Overrides:
afterin classorg.junit.rules.ExternalResource
-
start
public void start()
-
stop
public void stop()
-
getBrokerURL
public String getBrokerURL()
-
createDestination
protected ActiveMQDestination createDestination(String destinationName)
-
createBytesMessage
public BytesMessage createBytesMessage() throws JMSException
- Throws:
JMSException
-
createTextMessage
public TextMessage createTextMessage() throws JMSException
- Throws:
JMSException
-
createMapMessage
public MapMessage createMapMessage() throws JMSException
- Throws:
JMSException
-
createObjectMessage
public ObjectMessage createObjectMessage() throws JMSException
- Throws:
JMSException
-
createStreamMessage
public StreamMessage createStreamMessage() throws JMSException
- Throws:
JMSException
-
createMessage
public BytesMessage createMessage(byte[] body) throws JMSException
- Throws:
JMSException
-
createMessage
public TextMessage createMessage(String body) throws JMSException
- Throws:
JMSException
-
createMessage
public MapMessage createMessage(Map<String,Object> body) throws JMSException
- Throws:
JMSException
-
createMessage
public ObjectMessage createMessage(Serializable body) throws JMSException
- Throws:
JMSException
-
createMessage
public BytesMessage createMessage(byte[] body, Map<String,Object> properties) throws JMSException
- Throws:
JMSException
-
createMessage
public TextMessage createMessage(String body, Map<String,Object> properties) throws JMSException
- Throws:
JMSException
-
createMessage
public MapMessage createMessage(Map<String,Object> body, Map<String,Object> properties) throws JMSException
- Throws:
JMSException
-
createMessage
public ObjectMessage createMessage(Serializable body, Map<String,Object> properties) throws JMSException
- Throws:
JMSException
-
-