felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clement Escoffier <clement.escoff...@gmail.com>
Subject Re: iPojo Conundrum
Date Sun, 04 Sep 2011 09:42:58 GMT
Hi,


On 23.08.2011, at 00:05, john.dunlap@exceter.com wrote:

> I am looking into using Pax-Exam to run unit tests against iPojo bundles.
> However, as a Pax-Exam powered unit test is itself packaged into a bundle
> prior to being run I would like to be able to have iPojo inject services
> directly into the fields of my JUnit tests. However, I'm not really sure
> how this can be done with annotations unless it's already supported by the
> ipojo maven plugin because none of the iPojo annotations(by design) have a
> runtime retention policy so ipojo components cannot be detected
> reflectively. I know I can do it with pure xml configuration but I'd
> really prefer to use annotations if at all possible.
> 
> My simplest use case is this: I want to be able to annotate fields in my
> JUnit tests with @Requires and have iPojo inject dependent services.
> 
> Does this functionality already exist or would I have to implement it?

I'm not sure it is possible using pure iPOJO. Maybe pax exam contains such annotation, but
pax exam tests cannot be iPOJO components (at least not easily).
I generally use http://wiki.chameleon.ow2.org/xwiki/bin/view/Main.Testing/OSGi_Helpers to
get my services from my tests.

Regards,

Clement

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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message