I think the consumer template should work.
String body =
consumer.receiveBody("activemq:Player.1.VirtualTopic.TABLE.1",
String.class);


Or you can try to setup the route rule first for the Unit test.

form("activemq:Player.1.VirtualTopic.TABLE.1").to("mock:player1");

then you can using the camel mock API[1] to check if the mock endpoint get the message.

[1]http://camel.apache.org/mock.html

Willem

Mick Knutson wrote:
That is what I am trying to wrap my head around. I am trying to figure out a
way to either create a consumer like:
http://camel.apache.org/activemq.html

But still can't seem to understand how to fit this into a unit test in
question. Not sure how that sets a remote destination which is what I need
right?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Wed, Aug 5, 2009 at 6:03 PM, Willem Jiang <[email protected]> wrote:

Can your consumer start to receive the message before calling the
sendStatusUpdate method ?

You may need using other thread to call the sendStatusUpdate.

Willem

Mick Knutson wrote:

Is there anything else I would have to setup with my embedded broker to be
able to test sending a message to a VirtualTopic to get routed to the
subscribed Queues?

Here is what I have on my server:


   *...@endpointinject(uri="activemq:**VirtualTopic.TABLE.1")
   ProducerTemplate producer;

   public boolean sendStatusUpdate(String body) {
       log.info("//------------------**------------------------------**
----------------//");
       log.info("sendStatusUpdate: " + body);
       log.info("//------------------**------------------------------**
----------------//");

       //Send message to
       producer.sendBody("<hello>**world!</hello>");

       return true;
   }*


Here is my client unit test:

   *...@test
   public void testGetStatusUpdateMessage() throws Exception {
       log.info("testGetStatusUpdateMessage");

       TableService tableService = (TableService)
context.getBean("tableServiceProxy");
       boolean response = tableService.sendStatusUpdate("123");
       log.info("... the bet was successfully placed: " + response);
       assertTrue(response);

       String body =
consumer.receiveBody("activemq:Player.1.VirtualTopic.TABLE.1",
String.class);

       assertEquals("Hello World", body);

   }*


Now I am not able to get any body messages on
*activemq:Player.1.VirtualTopic.TABLE.1
a*nd I have only used the embedded broker at this point.

So what actually happens is my tests run freezes. I assume it is waiting
for
a message to be delivered onto *activemq:Player.1.VirtualTopic.TABLE.1
*that
never arrives.


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---




Reply via email to