Wednesday, April 22, 2009

Exciting April

It is an exciting time currently: OSGi gets a lot of buzz on the web currently, Pax Tools are getting release after release (Pax Runner 0.19.0 is out as well as Pax Exam 0.5 will follow soon), the proposal for a dedicated talk about pax tooling at the OSGi Devcon Europe in Zurich has been prepared.

OSGi Buzz in April
There is


Pax Runner 0.19.0
On April, 21, Alin Dreghicu released Pax Runner 0.19.0 which has the following highlights:
  • Support or Knopflerfish 2.3.0

  • Solve the problem introduced by Pax Runner - 0.18.0, that it did not work on windows anymore

  • Ability to supply Pax Runner options as system properties (-D)

Pax Exam 0.5.0
This release will be out very soon (as soon as i am back home from hungary) and will include a variety of improvements and some new features like
  • environment controlled debugging support (on/off by context)
  • specifying optional configuration based on context (PAXEXAM-59)
  • Inception of TinyBundles (see Exam Labs)
  • Support of latest pax tools (runner+url)

OSGi DevCon Europe 2009
We are preparing a proposal for 50mins packed with hands-on experience of Pax Construct, Pax Runner and Pax Exam .
Hopefully it will be accepted, seeing you in Zurich then ?

Personal Changes
Also, i will switch my main corporate project in may, while its not clear how it will end up.
Even though, i am still looking for interesting projects that incorporate OSGi.
Does you company want to embrace OPS4J Pax Tools ? How about having developers right inside your project ?

Sunday, April 12, 2009

Easter Egg

Low volume these days.
Because (at least in germany) eastern is about finding gifts/easter eggs.
I want to give you an easteregg as well.
For early adopters there is a new project in my ops4j laboratory called TinyBundles.
Its a small library that allows definition+creation of (tiny) bundles on the fly right inside your java app / pax exam testcase.
With this small library you can create small bundles like so:


newBundle()
.set( Constants.BUNDLE_SYMBOLICNAME, "MyFirstTinyBundle" )
.set( Constants.EXPORT_PACKAGE, "org.ops4j.pax.tinybundles.demo" )
.set( Constants.IMPORT_PACKAGE, "org.ops4j.pax.tinybundles.demo,org.osgi.framework" )
.set( Constants.BUNDLE_ACTIVATOR, MyFirstActivator.class.getName() )
.addClass( MyFirstActivator.class )
.addClass( HelloWorld.class )
.addClass( HelloWorldImpl.class )
.build( asStream() )

I found this quite useful when for example testing extender-bundles like PaxWeb or SpringDM.
As you see, resources are pulled from "current classpath" which means that you can easily contruct stuff like you do in ordinary java apps and pull them together using a fluent api like the above.
It is also trivial to create thounsands of (different) bundles to test high load for example.

Will try to put that into a regular pax project so that it get more "official".
That being said, the library is usable right now when used like specified in the demo sub project:
Demos.

Just checkout the whole project here, run mvn clean install (probably with "-Dmaven.test.skip=true to skip long running tests that may change all the time (remeber, its still in my local incubator ;) ,open it in your favourite ide and play with the demos if you like to.

Wishing everyone a nice easter weekend!

Friday, April 10, 2009

New and Newsworthy in Pax Exam 0.4

Pax Exam 0.4 has been released today!
There are not less than 19(!) features and enhancements in this release compared to the 0.3 version about one month ago. (Pax Exam Roadmap)


New Maven Plugin

There is now a maven plugin shipping with exam that allows you to define most configurations including dependencies right inside your pom.
Just configure the plugin like so:





org.ops4j.pax.exam
maven-paxexam-plugin


generate-paxexam-config

generate-paxexam-config




provided

${target-framework}







Then you let the test know you want to pull the configuration from maven instead of defining them right inside the TestCase:

@RunWith( org.ops4j.pax.exam.junit.MavenConfiguredJUnit4TestRunner.class )
public class DependencyTest
{

@Inject
BundleContext context;

@Test
public void usePlugin()
{
assertNotNull( context );
}
}


Maven Archetype
You can get started with paxexam very quickly by using the new archetype.
Just run for example this mvn command to create a pre-configured maven based pax exam project.

mvn archetype:create -DarchetypeGroupId=org.ops4j.pax.exam -DarchetypeArtifactId=paxexam-junit-archetype -DarchetypeVersion=0.4.0-SNAPSHOT -DgroupId=com.company -DartifactId=company-osgitests

Mock Frameworks
Pax Exam now has bundled profiles of the following mock frameworks for you ready to use:
  • EasyMock
  • Mockito
  • JMock
More Profiles
Thanks to Pax Runner 0.18, which comes with pax exam 0.4 we support much more profiles.
Here are some:
  • CXF (webservices,soap)
  • equinox configadmin
  • equinox DS
  • equinox even admin
  • equinox http service
  • equinox preference
  • felix configadmin
  • felix DS
  • felix event admin
  • felix webconsole
  • modulefusion.hibernate
  • modulefusion.ipojo
  • modulefusion.wicket
  • peaberry
  • servicemix kernel gshell (karaf, anyone ?)
  • spring dm
  • Pax Web
  • Pax URL
  • .. and much more
The latest supported frameworks are:
  • Apache Felix 1.6.0
  • Equinox 3.5 M6
  • Knopflerfish 2.2.1
  • Concierge 1.0 RC2
To see all resolved tasks have a look at Pax Exam Roadmap.