2007/9/28, Paul Duffin <[EMAIL PROTECTED]>: > Damien, > The majority of my OSGi bundles don't yet provide a service (although > they will eventually), I am just porting them from a non OSGi > environment in which we typically used reflection to load an > implementation of a factory (defined in the API). That means that they > typically pack the API and SP together.
No problem, it works fine for only one SP. > Just to clarify, the API artifact is a normal JAR that contains the API > classes yep > The SP artifact is an OSGi bundle that contains both the API > and the SP classes. It uses the <Embed-Dependency> instruction from the > felix bundle plugin to include the API (selected using package). The > <scope>provided</scope> will hide the dependency between the bundle and > the seperate API artifact. yep > I presume that for testing the SC you have a dependency on the SP/API > bundle artifact. How do you test the SC, inside an OSGi container or > within unit tests ? If the latter how do you do it, do you mock up an > OSGi container, break encapsulation and create the service directly, > mock up the service ? Both - Automaticaly with unit tests and many mock implementation of API. We use Declarative Services as much as possible not to be coupled with OSGi framework API. That's easier to test - Inside OSGi container, by our testers, with real SP or other mock SP when it's hard to test the real implementation of SP > Do you do also have a runtime dependency between SC and SP/API ? I know > you don't need one as the SC can use any relevant service. No dependency between SC and SP at all SC depends only on API, it shouldn't not be aware about any SP > How do you assemble your application ? With an assembly, which as a submodule of parent pom. The assembly describes the bundles it needs through dependencies : - SC + SP (includes API) - or SC + API + SP Damien Lecan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
