Most of the comments are agreed here. In fact, the maven plugin mostly 
delegates to the EquinoxHost in the tuscany-node-launcher-equinox module. As a 
summary, the launcher provides the following functions:

1) Locate the Tuscany runtime jars/bundles (from a ditro, from classpath, from 
maven dependencies, from osgi bundles etc)
2) Bootstrap the runtime
3) Locate the runnables (such as the main class or JUNIT test cases) and 
execute them

Thanks,
Raymond


From: Simon Laws 
Sent: Tuesday, January 20, 2009 4:11 AM
To: [email protected] 
Subject: Re: Run junit test cases in maven with OSGi


Thanks for the info Raymond

snip...



  1) The maven plug finds the dependencies and use them as the list of jars 
(bundles) to be installed to the Equinox runtime. We also package the main and 
test code into a bundle so that all the classes (main/test and 
tuscany/3rd-party) are loaded by OSGi. Typically the current project will have 
dependencies on the SCA API/annotations or Tuscany API, the maven surefire 
plugin will create a URL classloader and it makes the main/test classes get the 
SCA/Tuscany API classes from JSE instead of OSGi.

  2)  I assume most of our Junit test cases start/stop Node using the Tuscany 
Node APIs. The plugin approach makes it possible to run the test cases under 
both JSE and OSGi without changing the code.

What I was getting at in my initial question is that this sounds a lot like the 
launcher code we have + the code that wraps up the module and the test and + 
the code that fires up junit. So it sounds like we are describing a set of 
launcher functions. The current base function being

Launcher (for command line)
    Get dependencies and create OSGi runtime
    Get contributions and start node

And extending  this you are creating another launcher to handle a specific 
environment 

Launcher (for junit)
     Bundle up module and tests
     Fire up JUnit

It just so happens you have wrapped all this up in a maven plugin.  The Junit 
launcher function could be useful from the command line or from Eclipse. So I 
think this is good input to our launcher discussion

I'm not particularly proposing to change anything immediately but lets see what 
happens on the other discussion. I'd rather have a coherent launcher story and 
a maven plugin that exploits it rather thant some specific function buried in 
the maven plugin mojo. That's all I was getting at. 

Regards

Simon

Reply via email to