You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ywang9009 <yw...@gmail.com> on 2015/09/18 16:10:39 UTC

Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

This is one of the 2 shortcoming I discovered with Fuse/Karaf

I have been using Fuse for only 1 year. What I have encountered is it lacks
the ability to do unit testing because of inter-bundle dependencies. The
concept is great, or better than the monlithic WAR/EAR deployment. Maybe
someone else has figured out a way to do this. Please share. Thank you




--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by ywang9009 <yw...@gmail.com>.
Achim,

I downloaded the project, ran "mvn clean test" inside the project folder. I
am getting this error:

2015-09-22 10:13:15,049 | WARN  | FelixStartLevel  | FeatureValidationUtil           
| 1 - org.apache.karaf.features.core - 3.0.0 | Old style feature file
without namespace found (URI:
file:/Users/gyw97/COX/CBIG/code/Camel-Pax-Exam-Demo/route-control/target/paxexam/unpack/9ea5788f-6406-4721-8458-87b8ef9ffb18/test-dependencies.xml).
This format is deprecated and support for it will soon be removed
2015-09-22 10:13:15,818 | WARN  | FelixStartLevel  | FeatureValidationUtil           
| 1 - org.apache.karaf.features.core - 3.0.0 | Old style feature file
without namespace found (URI:
mvn:org.apache.camel.karaf/apache-camel/2.12.2/xml/features). This format is
deprecated and support for it will soon be removed
2015-09-22 10:13:16,686 | WARN  | FelixStartLevel  | FeatureValidationUtil           
| 1 - org.apache.karaf.features.core - 3.0.0 | Old style feature file
without namespace found (URI:
mvn:org.apache.activemq/activemq-karaf/5.9.0/xml/features). This format is
deprecated and support for it will soon be removed
2015-09-22 10:13:45,075 | WARN  | FelixStartLevel  | AetherBasedResolver             
| 44 - org.ops4j.pax.url.mvn - 1.6.0 | Error resolving
artifactde.nierbeck.camel.exam.demo:entities:jar:0.1.0-SNAPSHOT:Could not
find artifact de.nierbeck.camel.exam.demo:entities:jar:0.1.0-SNAPSHOT in
defaultlocal
(file:/Users/gyw97/COX/CBIG/code/Camel-Pax-Exam-Demo/route-control/target/paxexam/unpack/9ea5788f-6406-4721-8458-87b8ef9ffb18/$%7Buser.home%7D/.m2/repository/)
org.sonatype.aether.resolution.ArtifactResolutionException: Could not find
artifact de.nierbeck.camel.exam.demo:entities:jar:0.1.0-SNAPSHOT in
defaultlocal
(file:/Users/gyw97/COX/CBIG/code/Camel-Pax-Exam-Demo/route-control/target/paxexam/unpack/9ea5788f-6406-4721-8458-87b8ef9ffb18/$%7Buser.home%7D/.m2/repository/)
	at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
	at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
	at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
	at
org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
	at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:250)
	at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolveFile(AetherBasedResolver.java:239)
	at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:223)

Do you have any ideas?

Thanks for your help!





--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771796.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

as jboss uses a karaf after all, make sure your test works with a vanilla
karaf and you should be fine.

regards, Achim

2015-09-21 21:01 GMT+02:00 ywang9009 <yw...@gmail.com>:

> Achim, I think I have seen this article. I tried everything I could find
> from
> google. I am using jboss-fuse-full-6.1.0.redhat-379.zip. I think the karaf
> version it uses has some peculiarity getting what it needs. I will follow
> that article and try again. But I doubt I will have any luck. Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by ywang9009 <yw...@gmail.com>.
Achim, I think I have seen this article. I tried everything I could find from
google. I am using jboss-fuse-full-6.1.0.redhat-379.zip. I think the karaf
version it uses has some peculiarity getting what it needs. I will follow
that article and try again. But I doubt I will have any luck. Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771730.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

quite some time ago I wrote a blog about how to test with Pax-Exam [1].
Might be of interest for you.

regards, Achim

[1] -
http://notizblog.nierbeck.de/2013/08/testing-camel-jpa-routes-with-pax-exam-and-karaf/

2015-09-21 16:44 GMT+02:00 ywang9009 <yw...@gmail.com>:

> Christian, thanks for the reply. Yes I was talking about inter-bundle
> dependency. One example is like this: I have some common code which lives
> in
> another bundle so the current bundle depends on that bundle. I can't unit
> test the code in this bundle unless the common code bundle is loaded. I
> have
> seen example of using pax-exam, but I couldn't get it to work. Do you have
> any suggestion to address this scenario? Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by ywang9009 <yw...@gmail.com>.
Christian, I guess it's not that black and white. Let's say there are JPA
entities in another bundle and DAO/service code is in a different bundle.
How would you unit test the DAO code without JPA code? This would become
worse if your implementation is in blueprint. I am looking for any
suggestions that would make the testing (by developer) easier in karaf
environment. Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771821.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by Christian Müller <ch...@gmail.com>.
But than it's an integration test (or something similar) and not an unit
test...

Best,
Christian
Am 21.09.2015 16:45 schrieb "ywang9009" <yw...@gmail.com>:

> Christian, thanks for the reply. Yes I was talking about inter-bundle
> dependency. One example is like this: I have some common code which lives
> in
> another bundle so the current bundle depends on that bundle. I can't unit
> test the code in this bundle unless the common code bundle is loaded. I
> have
> seen example of using pax-exam, but I couldn't get it to work. Do you have
> any suggestion to address this scenario? Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by ywang9009 <yw...@gmail.com>.
Christian, thanks for the reply. Yes I was talking about inter-bundle
dependency. One example is like this: I have some common code which lives in
another bundle so the current bundle depends on that bundle. I can't unit
test the code in this bundle unless the common code bundle is loaded. I have
seen example of using pax-exam, but I couldn't get it to work. Do you have
any suggestion to address this scenario? Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641p5771717.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit testing Fuse (Karaf) with camel implemented in blueprint (shortcoming 1)

Posted by Christian Müller <ch...@gmail.com>.
If you are talking about inter-bundle dependencies, than it's not an unit
test, right.
What kind of issues do you face (details please).

Best,
Christian
Am 18.09.2015 16:13 schrieb "ywang9009" <yw...@gmail.com>:

> This is one of the 2 shortcoming I discovered with Fuse/Karaf
>
> I have been using Fuse for only 1 year. What I have encountered is it lacks
> the ability to do unit testing because of inter-bundle dependencies. The
> concept is great, or better than the monlithic WAR/EAR deployment. Maybe
> someone else has figured out a way to do this. Please share. Thank you
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unit-testing-Fuse-Karaf-with-camel-implemented-in-blueprint-shortcoming-1-tp5771641.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>