Re: Gave up waiting for service dependencies during CamelBlueprintTestSupport test of custom camel component

2013-11-12 Thread wjmcdonald
It turns out that I had an incorrect type of packaging in my pom.xml file. 
It should have been packagingbundle/packaging  instead of 'jar'.  This
enabled the junit to pass.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Gave-up-waiting-for-service-dependencies-during-CamelBlueprintTestSupport-test-of-custom-camel-compot-tp5742737p5743131.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Gave up waiting for service dependencies during CamelBlueprintTestSupport test of custom camel component

2013-11-12 Thread Willem jiang
Thanks for the note, I just update the wiki page of camel blueprint test with 
this information.

--  
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 Wednesday, November 13, 2013 at 7:21 AM, wjmcdonald wrote:

 It turns out that I had an incorrect type of packaging in my pom.xml file.  
 It should have been packagingbundle/packaging instead of 'jar'. This
 enabled the junit to pass.
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Gave-up-waiting-for-service-dependencies-during-CamelBlueprintTestSupport-test-of-custom-camel-compot-tp5742737p5743131.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Gave up waiting for service dependencies during CamelBlueprintTestSupport test of custom camel component

2013-11-06 Thread wjmcdonald
I've created a custom component (talend) which passes its own junit test. 
I've mvn installed 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.


Re: Gave up waiting for service dependencies during CamelBlueprintTestSupport test of custom camel component

2013-11-06 Thread Willem jiang
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 installed 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).