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: Gave up waiting for service" dependencies during CamelBlueprintTestSupport test of custom camel component
Date Thu, 07 Nov 2013 00:55:02 GMT
As camel-blueprint-test loads the bundle from class path to simulate the OSGi platform behaviour.
If you want to CamelBlueprintTestSupport find your custom component, you need to add the dependencies
of the customer component in your pom.


--  
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 Thursday, November 7, 2013 at 4:19 AM, wjmcdonald wrote:

> I've created a custom component ("talend") which passes its own junit test.  
> I've "mvn install"ed it to my local repo.  
>  
> Now I want to use the component. So I have a separate blueprint project. I
> have camel.version set to 2.11.2 and the new component as a dependency in
> this project's pom.xml - eclipse finds it just fine (listed as Maven
> Dependency in Project tree view). In the blueprint.xml file, a route sends
> a message to the new component ("talend"). When I run the junit test in the
> blueprint project (RouteTest.java) to exercise the camel route that calls my
> custom component ("talend"), the camel output says:
>  
> [ Blueprint Extender: 2] BlueprintContainerImpl INFO Bundle
> RouteTest is waiting for dependencies
> [(&(component=talend)(objectClass=org.apache.camel.spi.ComponentResolver))]
> [ Blueprint Extender: 1] BlueprintContainerImpl INFO Bundle
> remitJob is waiting for dependencies
> [(&(component=talend)(objectClass=org.apache.camel.spi.ComponentResolver))]
>  
> and eventually times out with the message:
>  
> testRoute(org.remitJob.RouteTest) Time elapsed: 30.898 sec <<< ERROR!
> java.lang.RuntimeException: Gave up waiting for service
> (objectClass=org.apache.camel.CamelContext)
>  
> The 'talend' custom component should be auto discovered: in the custom
> component jar file it has
> META-INF/services/org/apache/camel/component/talend file contains
> class=org.talend.camel.TalendComponent
> which is located in the same jar file at
> org/talend/camel/TalendComponent.class
>  
> The RouteTest class extends CamelBlueprintTestSupport. So it appears that
> the CamelBlueprintTestSupport cannot auto discover my component 'talend'.  
> Yet it should be in the classpath since Maven has resolved the jar
> dependency which contains the service file 'talend', no?
>  
> Perhaps there is an example, not just of how to create a custom component
> with auto-discovery, but also how to then use it with a junit in a
> CamelBlueprintTestSupport case?
>  
> Any ideas on why it can't find my service/component?
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Gave-up-waiting-for-service-dependencies-during-CamelBlueprintTestSupport-test-of-custom-camel-compot-tp5742737.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message