Hi,
On 23.08.2011, at 00:05, [email protected] 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: [email protected] > For additional commands, e-mail: [email protected] >

