You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by CamelTyro <32...@qq.com> on 2013/10/29 06:09:30 UTC
how to test the restlet service without startup web containner
manually
Hello
I met a problem when testing the restlet service, I config my restlet
service by adding the following snippet in web.xml:
<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>org.restlet.ext.spring.SpringServerServlet</servlet-class>
<init-param>
<param-name>org.restlet.component</param-name>
<param-value>RestletComponent</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/rs/*</url-pattern>
</servlet-mapping>
Then I config the router by using camel:restlet component by
"restlet:/cis/querypatientInfo/{code}?restletMethods=post,get"
I can access the service throught the url e.g.
http://localhost:58080/myproject/rs/cis/querypatientInfo/634062 via browser
The question is how can I test it by junit , without manually startup the
web containner, does everybody met this problem? please provide me how to
resolve it.
Thanks sincerely.
--
View this message in context: http://camel.465427.n5.nabble.com/how-to-test-the-restlet-service-without-startup-web-containner-manually-tp5742339.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: how to test the restlet service without startup web
containner manually
Posted by Willem jiang <wi...@gmail.com>.
If you just want to test the camel route, you don’t have to start the web container.
But if you want to test the restlet, I’m afraid you need to do that.
--
Willem Jiang
Red Hat, Inc.
Web: 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 Tuesday, October 29, 2013 at 3:51 PM, CamelTyro wrote:
> Must I startup a web container
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-test-the-restlet-service-without-startup-web-containner-manually-tp5742339p5742343.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: how to test the restlet service without startup web containner
manually
Posted by CamelTyro <32...@qq.com>.
Must I startup a web container
--
View this message in context: http://camel.465427.n5.nabble.com/how-to-test-the-restlet-service-without-startup-web-containner-manually-tp5742339p5742343.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: how to test the restlet service without startup web
containner manually
Posted by Willem jiang <wi...@gmail.com>.
Hi,
How about use HttpUnit[1] to start a web container and using Spring to load the camel context?
[1]http://httpunit.sourceforge.net/
--
Willem Jiang
Red Hat, Inc.
Web: 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 Tuesday, October 29, 2013 at 1:09 PM, CamelTyro wrote:
> Hello
> I met a problem when testing the restlet service, I config my restlet
> service by adding the following snippet in web.xml (http://web.xml):
>
> <servlet>
> <servlet-name>RestletServlet</servlet-name>
> <servlet-class>org.restlet.ext.spring.SpringServerServlet</servlet-class>
> <init-param>
> <param-name>org.restlet.component</param-name>
> <param-value>RestletComponent</param-value>
> </init-param>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>RestletServlet</servlet-name>
> <url-pattern>/rs/*</url-pattern>
> </servlet-mapping>
> Then I config the router by using camel:restlet component by
> "restlet:/cis/querypatientInfo/{code}?restletMethods=post,get"
> I can access the service throught the url e.g.
> http://localhost:58080/myproject/rs/cis/querypatientInfo/634062 via browser
> The question is how can I test it by junit , without manually startup the
> web containner, does everybody met this problem? please provide me how to
> resolve it.
> Thanks sincerely.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-test-the-restlet-service-without-startup-web-containner-manually-tp5742339.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).