Hello,

I am trying to write some unit tests around an embedded ActiveMQ configured
using the suggested testing configuration:

ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");

When I try to use the producer to send a message from a
session.createBlobMessage(...) the unit test responds with the following
exception:

javax.jms.JMSException: Connection refused: connect
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
        at
org.apache.activemq.command.ActiveMQBlobMessage.onSend(ActiveMQBlobMessage.java:176)
        at
org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1674)
        at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:231)
        at
org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
        ...
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
        at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:837)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:778)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:703)
        at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:881)
        at
org.apache.activemq.blob.DefaultBlobUploadStrategy.uploadStream(DefaultBlobUploadStrategy.java:59)
        at
org.apache.activemq.blob.BlobUploader.upload(BlobUploader.java:53)
        at
org.apache.activemq.command.ActiveMQBlobMessage.onSend(ActiveMQBlobMessage.java:173)
        ... 32 more 

It looks like the client is trying to upload the 'blob' and failing to do so
because of a connection problem (refused).

Is there a better way to test around the blob message functionality?  Maybe
mocking the functionality further than simply embedding activemq?

Thanks for your reply.

John
-- 
View this message in context: 
http://old.nabble.com/Testing-around-BlobMessage-tp27333888p27333888.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to