Hi

Maybe if its/was possible to setup the host and port on the
RestletComponent, then the endpoint can fallback and use those options
if non specified in the uri. Then for production they can be / to
indicate servlet, and for unit test, you can set it up to a localhost
8080 or whatever.



On Fri, Jul 13, 2012 at 2:50 PM, Magnus Palmér
<magnus.palmer.w...@gmail.com> wrote:
> After following the "Using the Restlet servlet within a webapp"
> documentation at http://camel.apache.org/restlet.html I refactored my
> Restlet endpoints by removing protocol, host and port.
> So from "restlet:http://host:port/path/{id}"; to "restlet:/path/{id}".
> This works great when running in a servlet container.
>
> However my JUnit tests no longer works since, the reason for this is that
> when using the applicationContext the protocol and host is set to null and
> port is defaulted to 80 in
> the org.apache.camel.component.restlet.RestletComponent.createEndpoint(String
> uri, String remaining, Map parameters).
>
> The only resolution that I know will work is to manipulate the URI by using
> "http://host:port"; in test and "" otherwise.
> Any ideas is highly appreciated otherwise I will have to satisfy with
> manipulating the URIs.
> (I am using both the real applicationContext and a test applicationContext
> in my JUnit tests that extends CamelSpringTestSupport, and they have among
> other things a Spring context:property-override definition where I can put
> configuration).
>
> Looking at the JUnit tests in Camel source all routes are configured using
> "restlet:http://host"; + portnum + "/path" for the camel-restlet component.
>
>
> Kind regards, Magnus



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to