camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Classpath resource endpoint?
Date Fri, 03 Sep 2010 01:04:02 GMT
I'm afraid we don't have a classpath component as you want.
If you just want to run unit test with an inputstream, you could define 
the route like this
   from("direct:test").to ...
And then using producerTemplate to send the inputstream  which you get 
from the classpath into the "direct:test" endpoint.

If you don't want to change the route, you could leverage 
camel-properties component[1] to replace the "file" endpoint into 
"direct" endpoint.

[1]https://cwiki.apache.org/CAMEL/properties.html

Willem

Meise, Christoph wrote:
> Hi all,
> 
> We have several projects (B, C and D) which rely on testdata coming from project A. Up
to now for example project B resolved project A and put the provided testdata into some defined
spot (inputFileOrDirectoryName) which was on the eclipse classpath. Than in a testcase a route
could be built like this one:
> 
>     new RouteBuilder() {
>       @Override
>       public void configure() throws Exception {
>         from("file:" + inputFileOrDirectoryName + "?noop=true").to("log:before.transformation.log").to(
>           "xslt:" + transformationFile).to("mock:checkpoint").to("log:after.transformation.log");
>       }
>     };
> 
> Basically it loaded an xml-file, transformed it and did some logging. Now the question
arises whether there exists component that can load a resource from the classpath (using either
a provided A.jar or the eclipse project A):
>        ... from("classpath:" + inputFile).to("log:before.transformation.log").to( ...
> I would be glad to receive any help on this issue even stating something like: "No, there
is not". If there was nothing, would there be a wish provide it?
> 
> Kind Regards,
> Christoph Meise
> IT Systems&Services, Team SAT
> 
> Immobilien Scout GmbH
> Andreasstraße 10 	
> 10243 Berlin 
> Fon +49 (0)30 24301-1378
> Fax +49 (0)30 24301-1110
> christoph.meise@immobilienscout24.de
> 
> ---------------------------------------------------------------
> Immobilien Scout GmbH
> Beirat: Dr. Martin Enderle (Vorsitzender)
> Geschäftsführer: Dirk Hoffmann, Marc Stilke (Sprecher)
> Handelsgericht: Amtsgericht Charlottenburg, HRB 69108
> Sitz der Gesellschaft: Berlin
> ---------------------------------------------------------------
> 
> http://www.immobilienscout24.de
> Der Marktführer: Deutschlands größter Immobilienmarkt
> 


Mime
View raw message