Hi,

What does your routes look like?
Do you need to simulate the Server behavior to the client (which could be a 
camel route) to test?

If you want to use the HttpUnit, you have to use the HttpUnit client API to 
invoke the service.
You can also try to start a embed Jetty server which can hold the reference of 
camel servlet, and create the route builder with Java code.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Thursday, January 24, 2013 at 10:37 PM, Zemin Hu wrote:

> Actually I have been considering using jetty, I just have not tried out yet.
> Let me know if you have some ready samples in hand for this purpose. I would
> imagine if I use jetty, I have to put "jetty:" in front of all URIs, then
> remove them after unit test, if you want to do test again, you have to
> repeat these steps. Can you think of some other elegant way to do it? And
> another thought: since I can see all the routes actually are started by
> SpringCamelContext when I ran this test, I can find them from the log:
> SpringCamelContext INFO Route: route90 started and consuming
> from: Endpoint[servlet:///test/simple]  
> Where does SpringCamelContext keep them? are the routes in memory? are they
> accessible from some APIs if they are not published as web services?
>  
> I looked at the unit test code for camel-servlet that you pointed out, they
> use something from com.meterware.httpunit to start another servlet
> environment, I already have jetty configured in my environment as plug-in,
> so I don't want to do that. Another reason is that all tests are built
> around Java DSL based routes, no Spring XML DSL route tests. I don't want to
> dig that deep.
> Thanks.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/HTTP-Endpoint-construction-in-CamelSpringTest-tp5726090p5726165.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to