Nevermind...I was thinking clearly with your post...

My unit test will only run in one JVM so the seda queues will work
perfectly...

Claus Ibsen-2, you have been a great help!


Lotsa wrote:
> 
> Sorry for the poor clarification...The reason I am using a JMS Queue is
> because I need to go across VMs
> 
> 
> 
> Claus Ibsen-2 wrote:
>> 
>> On Thu, Jul 9, 2009 at 7:41 PM, Lotsa<nos...@mailinator.com> wrote:
>>>
>>> I was wondering if anyone has a solution to testing camel routes that
>>> end
>>> with an activemq endpoint.  Specifically,
>>>
>>> <route>
>>>   <from ref="endpoint"/>
>>>   ...some logic...
>>>   <to ref="MyQueue"/> -> myQueue is a defined endpoint
>>> ...activemq:queue:myqueue/in in my actual code
>>>                                    In my test code MyQueue is defined as
>>> mock ...mock:MyQueue
>>> </route>
>>>
>>> <route>
>>>   <from ref="MyQueue"/>
>>>   ...etc...
>>> </route>
>>>
>>> The problem I am having is that I am getting an error stating that I
>>> cannot
>>> consume from this endpoint.  If I remove the second route I have no
>>> issues.
>>> I understand that this will not work with a mock, so I was wondering
>>> what
>>> the correct procedure would be to 'mock' out a queue
>> 
>> Instead of a JMS queue you should use seda instead. It behaves like a
>> JMS queue but for intra JVM only.
>> 
>> .to("seda:queue:foo")
>> 
>> from("seda:queue:foo").to("mock:result");
>> 
>> 
>> 
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Problems-Unit-Testing-Camel-Routes-tp24414728p24414728.html
>>> Sent from the Camel - Users (activemq) mailing list archive at
>>> Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>> 
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-Unit-Testing-Camel-Routes-tp24414728p24415052.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Reply via email to