Class EmbeddedJMSResource
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.apache.activemq.artemis.junit.EmbeddedJMSResource
-
- All Implemented Interfaces:
EmbeddedJMSOperations<EmbeddedJMSResource>,org.junit.rules.TestRule
@Deprecated public class EmbeddedJMSResource extends org.junit.rules.ExternalResource implements EmbeddedJMSOperations<EmbeddedJMSResource>
Deprecated.Deprecated in favor of EmbeddedActiveMQResource. Since Artemis 2.0 all JMS specific broker management classes, interfaces, and methods have been deprecated in favor of their more general counter-parts. A JUnit Rule that embeds an ActiveMQ Artemis JMS server into a test. This JUnit Rule is designed to simplify using embedded servers in unit tests. Adding the rule to a test will startup an embedded JMS server, which can then be used by client applications.public class SimpleTest { @Rule public EmbeddedJMSResource server = new EmbeddedJMSResource(); @Test public void testSomething() throws Exception { // Use the embedded server here } }
-
-
Constructor Summary
Constructors Constructor Description EmbeddedJMSResource()Deprecated.Create a default EmbeddedJMSResourceEmbeddedJMSResource(boolean useNetty)Deprecated.Create a default EmbeddedJMSResourceEmbeddedJMSResource(int serverId)Deprecated.Create a default EmbeddedJMSResource with the specified server idEmbeddedJMSResource(String filename)Deprecated.Create an EmbeddedJMSResource with the specified configuration fileEmbeddedJMSResource(String serverConfigurationFileName, String jmsConfigurationFileName)Deprecated.Create an EmbeddedJMSResource with the specified configuration fileEmbeddedJMSResource(Configuration configuration, JMSConfiguration jmsConfiguration)Deprecated.Create an EmbeddedJMSResource with the specified configurations
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EmbeddedJMSResourceaddAcceptor(String name, String uri)Deprecated.protected voidafter()Deprecated.Stop the embedded ActiveMQ Brokerprotected voidbefore()Deprecated.Start the embedded ActiveMQ Brokerjavax.jms.BytesMessagecreateBytesMessage()Deprecated.javax.jms.MapMessagecreateMapMessage()Deprecated.javax.jms.BytesMessagecreateMessage(byte[] body)Deprecated.javax.jms.BytesMessagecreateMessage(byte[] body, Map<String,Object> properties)Deprecated.javax.jms.ObjectMessagecreateMessage(Serializable body)Deprecated.javax.jms.ObjectMessagecreateMessage(Serializable body, Map<String,Object> properties)Deprecated.javax.jms.TextMessagecreateMessage(String body)Deprecated.javax.jms.TextMessagecreateMessage(String body, Map<String,Object> properties)Deprecated.javax.jms.MapMessagecreateMessage(Map<String,Object> body)Deprecated.javax.jms.MapMessagecreateMessage(Map<String,Object> body, Map<String,Object> properties)Deprecated.javax.jms.ObjectMessagecreateObjectMessage()Deprecated.javax.jms.StreamMessagecreateStreamMessage()Deprecated.javax.jms.TextMessagecreateTextMessage()Deprecated.org.apache.activemq.artemis.core.server.QueuegetDestinationQueue(String destinationName)Deprecated.EmbeddedJMSgetJmsServer()Deprecated.longgetMessageCount(String destinationName)Deprecated.StringgetServerName()Deprecated.List<org.apache.activemq.artemis.core.server.Queue>getTopicQueues(String topicName)Deprecated.StringgetVmURL()Deprecated.javax.jms.BytesMessagepeekBytesMessage(String destinationName)Deprecated.javax.jms.MapMessagepeekMapMessage(String destinationName)Deprecated.javax.jms.MessagepeekMessage(String destinationName)Deprecated.javax.jms.ObjectMessagepeekObjectMessage(String destinationName)Deprecated.javax.jms.StreamMessagepeekStreamMessage(String destinationName)Deprecated.javax.jms.TextMessagepeekTextMessage(String destinationName)Deprecated.javax.jms.BytesMessagepushMessage(String destinationName, byte[] body)Deprecated.javax.jms.ObjectMessagepushMessage(String destinationName, Serializable body)Deprecated.javax.jms.TextMessagepushMessage(String destinationName, String body)Deprecated.javax.jms.MapMessagepushMessage(String destinationName, Map<String,Object> body)Deprecated.voidpushMessage(String destinationName, javax.jms.Message message)Deprecated.javax.jms.BytesMessagepushMessageWithProperties(String destinationName, byte[] body, Map<String,Object> properties)Deprecated.javax.jms.ObjectMessagepushMessageWithProperties(String destinationName, Serializable body, Map<String,Object> properties)Deprecated.javax.jms.TextMessagepushMessageWithProperties(String destinationName, String body, Map<String,Object> properties)Deprecated.javax.jms.MapMessagepushMessageWithProperties(String destinationName, Map<String,Object> body, Map<String,Object> properties)Deprecated.static voidsetMessageProperties(javax.jms.Message message, Map<String,Object> properties)Deprecated.voidstart()Deprecated.voidstop()Deprecated.
-
-
-
Constructor Detail
-
EmbeddedJMSResource
public EmbeddedJMSResource()
Deprecated.Create a default EmbeddedJMSResource
-
EmbeddedJMSResource
public EmbeddedJMSResource(boolean useNetty)
Deprecated.Create a default EmbeddedJMSResource
-
EmbeddedJMSResource
public EmbeddedJMSResource(int serverId)
Deprecated.Create a default EmbeddedJMSResource with the specified server id
-
EmbeddedJMSResource
public EmbeddedJMSResource(Configuration configuration, JMSConfiguration jmsConfiguration)
Deprecated.Create an EmbeddedJMSResource with the specified configurations- Parameters:
configuration- ActiveMQServer configurationjmsConfiguration- JMSServerManager configuration
-
EmbeddedJMSResource
public EmbeddedJMSResource(String filename)
Deprecated.Create an EmbeddedJMSResource with the specified configuration file- Parameters:
filename- configuration file name
-
EmbeddedJMSResource
public EmbeddedJMSResource(String serverConfigurationFileName, String jmsConfigurationFileName)
Deprecated.Create an EmbeddedJMSResource with the specified configuration file- Parameters:
serverConfigurationFileName- ActiveMQServer configuration file namejmsConfigurationFileName- JMSServerManager configuration file name
-
-
Method Detail
-
addAcceptor
public EmbeddedJMSResource addAcceptor(String name, String uri) throws Exception
Deprecated.- Specified by:
addAcceptorin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>- Throws:
Exception
-
setMessageProperties
public static void setMessageProperties(javax.jms.Message message, Map<String,Object> properties)Deprecated.
-
start
public void start()
Deprecated.- Specified by:
startin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
stop
public void stop()
Deprecated.- Specified by:
stopin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
before
protected void before() throws ThrowableDeprecated.Start the embedded ActiveMQ BrokerInvoked by JUnit to setup the resource
- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()
Deprecated.Stop the embedded ActiveMQ BrokerInvoked by JUnit to tear down the resource
- Overrides:
afterin classorg.junit.rules.ExternalResource
-
getJmsServer
public EmbeddedJMS getJmsServer()
Deprecated.- Specified by:
getJmsServerin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
getServerName
public String getServerName()
Deprecated.- Specified by:
getServerNamein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
getVmURL
public String getVmURL()
Deprecated.- Specified by:
getVmURLin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
getDestinationQueue
public org.apache.activemq.artemis.core.server.Queue getDestinationQueue(String destinationName)
Deprecated.- Specified by:
getDestinationQueuein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
getTopicQueues
public List<org.apache.activemq.artemis.core.server.Queue> getTopicQueues(String topicName)
Deprecated.- Specified by:
getTopicQueuesin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
getMessageCount
public long getMessageCount(String destinationName)
Deprecated.- Specified by:
getMessageCountin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createBytesMessage
public javax.jms.BytesMessage createBytesMessage()
Deprecated.- Specified by:
createBytesMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createTextMessage
public javax.jms.TextMessage createTextMessage()
Deprecated.- Specified by:
createTextMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMapMessage
public javax.jms.MapMessage createMapMessage()
Deprecated.- Specified by:
createMapMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createObjectMessage
public javax.jms.ObjectMessage createObjectMessage()
Deprecated.- Specified by:
createObjectMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createStreamMessage
public javax.jms.StreamMessage createStreamMessage()
Deprecated.- Specified by:
createStreamMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.BytesMessage createMessage(byte[] body)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.TextMessage createMessage(String body)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.MapMessage createMessage(Map<String,Object> body)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.ObjectMessage createMessage(Serializable body)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.BytesMessage createMessage(byte[] body, Map<String,Object> properties)Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.TextMessage createMessage(String body, Map<String,Object> properties)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.MapMessage createMessage(Map<String,Object> body, Map<String,Object> properties)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
createMessage
public javax.jms.ObjectMessage createMessage(Serializable body, Map<String,Object> properties)
Deprecated.- Specified by:
createMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessage
public void pushMessage(String destinationName, javax.jms.Message message)
Deprecated.- Specified by:
pushMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessage
public javax.jms.BytesMessage pushMessage(String destinationName, byte[] body)
Deprecated.- Specified by:
pushMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessage
public javax.jms.TextMessage pushMessage(String destinationName, String body)
Deprecated.- Specified by:
pushMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessage
public javax.jms.MapMessage pushMessage(String destinationName, Map<String,Object> body)
Deprecated.- Specified by:
pushMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessage
public javax.jms.ObjectMessage pushMessage(String destinationName, Serializable body)
Deprecated.- Specified by:
pushMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessageWithProperties
public javax.jms.BytesMessage pushMessageWithProperties(String destinationName, byte[] body, Map<String,Object> properties)
Deprecated.- Specified by:
pushMessageWithPropertiesin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessageWithProperties
public javax.jms.TextMessage pushMessageWithProperties(String destinationName, String body, Map<String,Object> properties)
Deprecated.- Specified by:
pushMessageWithPropertiesin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessageWithProperties
public javax.jms.MapMessage pushMessageWithProperties(String destinationName, Map<String,Object> body, Map<String,Object> properties)
Deprecated.- Specified by:
pushMessageWithPropertiesin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
pushMessageWithProperties
public javax.jms.ObjectMessage pushMessageWithProperties(String destinationName, Serializable body, Map<String,Object> properties)
Deprecated.- Specified by:
pushMessageWithPropertiesin interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekMessage
public javax.jms.Message peekMessage(String destinationName)
Deprecated.- Specified by:
peekMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekBytesMessage
public javax.jms.BytesMessage peekBytesMessage(String destinationName)
Deprecated.- Specified by:
peekBytesMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekTextMessage
public javax.jms.TextMessage peekTextMessage(String destinationName)
Deprecated.- Specified by:
peekTextMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekMapMessage
public javax.jms.MapMessage peekMapMessage(String destinationName)
Deprecated.- Specified by:
peekMapMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekObjectMessage
public javax.jms.ObjectMessage peekObjectMessage(String destinationName)
Deprecated.- Specified by:
peekObjectMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
peekStreamMessage
public javax.jms.StreamMessage peekStreamMessage(String destinationName)
Deprecated.- Specified by:
peekStreamMessagein interfaceEmbeddedJMSOperations<EmbeddedJMSResource>
-
-