You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by to...@gmail.com on 2009/01/22 17:36:07 UTC

spring-osgi test support, remote repository, and SCR

I'm trying to run an integration test for our application using spring-osgi  
testing framework. What i'm trying to do is:

1. Extend AbstractConfigurableBundleCreatorTests and have it startup the  
felix container and deploy the test class as a bundle
2. Use the RepositoryAdmin to download and install our application bundles.
3. Get a hold of SCR managed services and invoke methods to run the test.

I have it downloading and installing the bundles, but i can't find a way of  
finding and invoking component services from the bundle context. Is there a  
way of finding the services declared using the scr.service tag via the  
bundleContext? Are there any alternate paths to integration testing inside  
an OSGI container?

Thanks,

Tom Litton

Re: spring-osgi test support, remote repository, and SCR

Posted by Luke Patterson <lu...@gmail.com>.
Awesome.  Sounds like exactly what I am looking for.

(I'm using Maven btw)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: spring-osgi test support, remote repository, and SCR

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Jan 22, 2009 at 9:17 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Then I will try to post something with some simple instructions.

That would be great, I'm looking forward to more news on this.

BR,

Jukka Zitting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: spring-osgi test support, remote repository, and SCR

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Well, I have been working with Peter to get the latest version of BND 
integration testing to work in the Felix setup. Some of the issues are 
related to our use of Maven, so they might not impact you if you aren't 
using maven. From what I understand, the integration testing features 
are available in the normal BND release JAR, they just aren't documented 
yet.

BND leverages the new standard launching and embedding API to start the 
framework and install bundles into it. I won't claim to understand all 
the setup details, but I think it does make life a little easier for me.

The main bonus, I think, is that I don't actually have to create a bunch 
of separate projects for every test bundle. I can have one project from 
which BND creates a bunch of different bundles on the fly when I perform 
the test. This might not be important for some people, but when testing 
the framework itself, it is quite nice to not actually have to have a 
separate project for each test bundle, since I will ultimately need lots 
of different test bundles.

I have fixed one last issue I was having locally, but I was waiting to 
discuss it with Peter to see if he could integrate the patch. Then I 
will try to post something with some simple instructions.

-> richard

Luke Patterson wrote:
> I'm also interested in this topic.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: spring-osgi test support, remote repository, and SCR

Posted by Luke Patterson <lu...@gmail.com>.
I'm also interested in this topic.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: spring-osgi test support, remote repository, and SCR

Posted by Ray Racine <ra...@gmail.com>.
Extremely interested in this as well.  Please post final resolution on list.

On Thu, Jan 22, 2009 at 2:26 PM, Richard S. Hall <he...@ungoverned.org>wrote:

>
> tom.litton@gmail.com wrote:
>
>> Are there any alternate paths to integration testing inside an OSGI
>> container?
>>
>
> There is PAX Exam (aka PAX Drone).
>
> I am also looking into using BND for integration testing, which is what the
> OSGi Alliance is now using for their setup. I was going to try to make
> something available as an example, but I have been running into a few issues
> that need to be ironed out first.
>
> -> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: spring-osgi test support, remote repository, and SCR

Posted by "Richard S. Hall" <he...@ungoverned.org>.
tom.litton@gmail.com wrote:
> Are there any alternate paths to integration testing inside an OSGI 
> container?

There is PAX Exam (aka PAX Drone).

I am also looking into using BND for integration testing, which is what 
the OSGi Alliance is now using for their setup. I was going to try to 
make something available as an example, but I have been running into a 
few issues that need to be ironed out first.

-> richard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: spring-osgi test support, remote repository, and SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Tom,

tom.litton@gmail.com schrieb:
> I'm trying to run an integration test for our application using
> spring-osgi testing framework. What i'm trying to do is:
> 
> 1. Extend AbstractConfigurableBundleCreatorTests and have it startup the
> felix container and deploy the test class as a bundle
> 2. Use the RepositoryAdmin to download and install our application bundles.
> 3. Get a hold of SCR managed services and invoke methods to run the test.
> 
> I have it downloading and installing the bundles, but i can't find a way
> of finding and invoking component services from the bundle context. Is
> there a way of finding the services declared using the scr.service tag
> via the bundleContext? Are there any alternate paths to integration
> testing inside an OSGI container?

I do not exactly understand what you are up to with respect to
"scr.service tag": Are you referring to the Maven SCR Plugin
@scr.service tag used in conjunction with @scr.component ? Are you thus
trying to automagically find out about components ?

If this is the case, there are two options here: The first option is
very portable but requires much hand-work: extract the SCR declaration
files from the bundles and parse them for the information you need.

The second option depends on using the Apache Felix Declarative Services
implementation: This registers a helper service
org.apache.felix.scr.ScrService, which can be queried for components.

Hope this helps.

Regards
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org