Simplify OSGi application tests with the OSGi Helper library

Testing OSGi applications and services has always been a difficult challenge. Despite the development of several frameworks such as OPS4J Pax Exam, or junit4osgi, writing tests requires a non-negligible amount of code to manage the OSGi aspect of the test. Indeed, waiting and getting the service under test or releasing the service requires dealing directly with the OSGi framework and so the OSGi API. The OSGi Helper library is a small collection of classes to let tests focus on the behavior to verify instead of drowning the code in the depths of the OSGi development model.

The OSGi Helper library was developed by the Innovation department of akquinet, and was contributed to the OW2 Chameleon project.

This post explains the benefits brought by the library in comparison to plain OSGi tests.
Continue reading

Integrating Scala components in a Java application

Scala is starting to be really popular, and there are many reasons why you might like to use it in your current projects. At akquinet we’re now using Scala inside Java applications to reduce the amount of written code and to benefit from Scala’s flexibility. However, integrating Java and Scala in the same application requires some tricks. Using Java classes in Scala is pretty straightforward; however, using Scala classes in Java is not.

Scala has several language features which cannot be directly mapped to Java, for example function types and traits. Here we will describe how these language features are compiled to Java byte code and how to access them from Java afterwards.

Continue reading