Hi Raymond Some questions inline.
Why can't we use the launcher in the Junit test to fire up the runtime rather that turning the test itself into a bundle. Are you tring to ensure that the junit test doesn't have to reach from the JSE world into the OSGi world? The launcher would be able to get the dependencies from the classpath but wouldn't be able to get at the bundelized 3rd party jars currently in PDE target. You seem to have some code for doing this on the fly so could this also be incorporated into the launcher. Simon On Fri, Jan 16, 2009 at 9:23 PM, Raymond Feng <[email protected]> wrote: > Hi, > > I have prototyped a maven plugin that can run junit test cases with the > Equinox OSGi runtime. It works as follows: > > 1) Generate a bundle for the current project with the target/classes Does this create an activator in the bundle to run the test? > > 2) Generate a bundle fragment that attaches to the bundle from step 1 What is this fragment for? > > 3) Find all the maven dependencies and use them as the set of initial > bundles (the plain jars are converted into a bundle on the fly too) > 4) Bootstrap the Equinox runtime > 5) Find all test cases and run them with the JUNIT runner How are the test cases identified? > > 6) Report the results of the test case > > To configure a maven project, use the following XML in the pom.xml (See an > example at [2]): > <plugin> > <groupId>org.apache.tuscany.sca</groupId> > <artifactId>tuscany-maven-osgi-junit</artifactId> > <version>2.0-SNAPSHOT</version> > <executions> > <execution> > <id>osgi-test</id> > <phase>test</phase> > <goals> > <goal>test</goal> > </goals> > </execution> > <configuration></configuration> > </executions> > </plugin> > > The ideal approach is to plug in the same logic into the existing > maven-surefire-plugin. But it doesn't seem that the surefire plugin has such > plug points. > > Please let me know if you have better ideas. > > Thanks, > Raymond > > [1] > https://svn.apache.org/repos/asf/tuscany/java/sca/tools/maven/maven-osgi-junit > [2] > https://svn.apache.org/repos/asf/tuscany/java/sca/samples/calculator-osgi/pom.xml > > > >
