
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831095 13f79535-47bb-0310-9956-ffa450edef68
84 lines
3.1 KiB
Text
84 lines
3.1 KiB
Text
A Maven plugin used by the Tuscany SCA project for OSGi JUnit testing. There's some discusssion about it at:
|
|
http://apache.markmail.org/message/uxt7afrquwc75qxj
|
|
|
|
The Tuscany OSGi Junit plugin is derived from maven-surefire-plugin to add the OSGi support. It takes the same set of configurations as maven-surefire-plugin. Here is what it does:
|
|
|
|
1) Generate two bundles for the main and test classes respectively. The test bundle is a fragment of the main bundle.
|
|
|
|
For example, the plugin generates the following bundles for sample-calculator-osgi.jar:
|
|
* sample-calculator-osgi-osgi.jar
|
|
* sample-calculator-osgi-osgi-tests.jar
|
|
|
|
2) Find the EquinoxHost class from tuscany-node-launcher-equinox and create an instance
|
|
3) Start the equinox runtime
|
|
4) Set up the classloader for surefire so that it uses OSGi classloading for the test cases with the test bundle.
|
|
5) Delegate to surefire to run the unit tests
|
|
|
|
Future improvement:
|
|
As now we use the OSGi framework launch APIs to start an OSGi runtime, it should be ideal to allow either Equinox
|
|
or Apache Felix as the runtime. The only difference would be a list of properties and we can make them configurable
|
|
for the plugin to take a property file.
|
|
|
|
To build, from the top maven-osgi-junit-plugin run maven:
|
|
|
|
mvn
|
|
|
|
or once all the dependencies have been downloaded and a succesful build run use:
|
|
|
|
mvn clean install -o
|
|
|
|
So as to avoid the Tuscany SCA project using SNAPSHOT dependencies any changes
|
|
to this module should be released and the Tuscany SCA project updated to use
|
|
the newly released version.
|
|
|
|
To release this module:
|
|
|
|
mvn release:prepare
|
|
|
|
followed by:
|
|
|
|
mvn release:perform
|
|
|
|
That will automatically create an SVN tag from the release, update the version
|
|
numbers in the pom.xml files in the trunk and tag, and deploy the artifacts to the
|
|
staging repository defined by the <deploy.altRepository> in your Maven settings.xml.
|
|
While running it will prompt you for the names for the tag, release version etc.
|
|
|
|
In your maven settings.xml file you must have a server defined named "apache.releases",
|
|
and a profile named "release". For example:
|
|
|
|
<servers>
|
|
...
|
|
<server>
|
|
<id>apache.releases</id>
|
|
<username>antelder</username>
|
|
<privateKey>\ant\id_dsa</privateKey>
|
|
<passphrase>xxx</passphrase>
|
|
<directoryPermissions>775</directoryPermissions>
|
|
<filePermissions>664</filePermissions>
|
|
</server>
|
|
</servers>
|
|
|
|
<profiles>
|
|
...
|
|
<profile>
|
|
<id>release</id>
|
|
<properties>
|
|
<gpg.passphrase>...</gpg.passphrase>
|
|
<deploy.altRepository>apache.releases::default::scp://people.apache.org/home/antelder/public_html/tuscany/maven-osgi-junit-plugin-1.0</deploy.altRepository>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
|
|
Call a vote to release the module, eg: http://apache.markmail.org/message/6jnlfxbx7uklt5nv
|
|
|
|
After a successful vote copy the staging artifacts to the live repository, eg:
|
|
|
|
cp -p -v -R maven-osgi-junit-plugin-1.0/org/apache/tuscany/maven/plugins/ /x1/www/people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/tuscany/maven/plugins
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|