You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2011/04/29 23:56:25 UTC

Migration from Spring-DM to Blueprint. How to test?

Hello list!

We are planing to migrate from ServiceMix 4.2.0-fuse-02-00 to
4.3.1-fuse-01-09 and from Camel 2.2.0-fuse-02-00 to Camel 2.6.0-fuse-01-09.
We also thinking about to migrate from Spring-DM to Blueprint.
At present, each of our projects contains three Spring configuration files:
- src/main/resources/META-INF/spring/bundle-context.xml
- src/main/resources/META-INF/spring/bundle-context-osgi.xml
- src/test/resources/META-INF/spring/bundle-context-test.xml

bundle-context.xml contains the route definition and all bean definitions.

bundle-context-osgi.xml looks up some beans from the OSGI registry (e.g.
ActiveMQ connection factory) and the OSGI Config service configuration
(osgix:cm-properties).

bundle-context-test.xml replaces the bundle-context-osgi.xml in our unit
tests and provides plain Spring bean definitions for the services we look up
from the OSGI service registry when deployed into ServiceMix.

But when we migrate to Blueprint, we depend on OSGI and I'm not sure if it's
possible to test our routes in the way we do it at present, using the
CamelTestSupport oder CamelSpringTestSupport. I know we also have
CamelOSGITestSupport, but it's more complex and less lightweight.

Do I miss something? Has anyone a sample test which use Blueprint and not
depend on PAX Exam?

Thanks in advance,
Christian

Re: Migration from Spring-DM to Blueprint. How to test?

Posted by Christian Müller <ch...@gmail.com>.
Hello Guillaume,
thanks for your response. Ade asked me to put this question also in the fuse
mailing list and added your answer.
We will wait a bit to migrate to Blueprint until there is a well proved
testing framework (the one you suggested or Pax 2).
Best,
Christian

Re: Migration from Spring-DM to Blueprint. How to test?

Posted by Guillaume Nodet <gn...@gmail.com>.
Last week, I've been experimenting with PojoSR
(http://code.google.com/p/pojosr/) which looks like a good solution
for testing OSGi stuff in a lightweight way.  The idea is that you
don't boot a full OSGi runtime, but rather emulate an OSGi framewokr
in a flat class loader.  This project has been initially developped to
deploy OSGi based applications into Google App Engine, and it seems to
work well enough.

Here's a test i've written:
   https://gist.github.com/953272
Note that by default, all maven dependencies that are bundles will be
installed in the osgi framework (which is static and does not support
dynamic addition or removal of bundles), so you need to exclude any
transitive dep you don't want.

The example above actually use blueprint, so it does indeed work.

On Fri, Apr 29, 2011 at 23:56, Christian Müller
<ch...@gmail.com> wrote:
> Hello list!
>
> We are planing to migrate from ServiceMix 4.2.0-fuse-02-00 to
> 4.3.1-fuse-01-09 and from Camel 2.2.0-fuse-02-00 to Camel 2.6.0-fuse-01-09.
> We also thinking about to migrate from Spring-DM to Blueprint.
> At present, each of our projects contains three Spring configuration files:
> - src/main/resources/META-INF/spring/bundle-context.xml
> - src/main/resources/META-INF/spring/bundle-context-osgi.xml
> - src/test/resources/META-INF/spring/bundle-context-test.xml
>
> bundle-context.xml contains the route definition and all bean definitions.
>
> bundle-context-osgi.xml looks up some beans from the OSGI registry (e.g.
> ActiveMQ connection factory) and the OSGI Config service configuration
> (osgix:cm-properties).
>
> bundle-context-test.xml replaces the bundle-context-osgi.xml in our unit
> tests and provides plain Spring bean definitions for the services we look up
> from the OSGI service registry when deployed into ServiceMix.
>
> But when we migrate to Blueprint, we depend on OSGI and I'm not sure if it's
> possible to test our routes in the way we do it at present, using the
> CamelTestSupport oder CamelSpringTestSupport. I know we also have
> CamelOSGITestSupport, but it's more complex and less lightweight.
>
> Do I miss something? Has anyone a sample test which use Blueprint and not
> depend on PAX Exam?
>
> Thanks in advance,
> Christian
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com/