OSGI Integration Testing and Code Coverage

We have Desktop app depolyed in OSGI bundles and have integration tests to test bundles loaded in OSGI container.

  • I need your help in getting a tool that caculates code coverage for integration tests with OSGI bundles ?
  • Currently we are trying to do with jacoco and sonar that is good for integration tests code coverage ,but we aren't sure whether they are good enought to handle OSGI integration test code coverage

  • also any other tools available to calculate OSGI integration test code coverage.


  • Most, if not all code coverage tools should work with OSGi. Their general strategy is to post process the bytecode to inject extra code that allows them to measure such coverage. The biggest issue that causes is that this code now usually has dependencies on extra code (the code coverage library). Such dependencies can either be made explicit (by adding Import-Package statements) just like with any other dependency. The other option you have is to add the code coverage library to your bootclasspath so you don't need those extra imports (which breaks modularity, normally not something you want, but in this case irrelevant). Once you solve this problem, the rest is a matter of instrumenting the right bundles and aggregating the results of multiple different test runs.


    我们继续采用第二种方法,它工作.Jacoco能够提供OSGI集成测试的测试覆盖率并在Sonar DashBoard中显示。

    链接地址: http://www.djcxy.com/p/10278.html

    上一篇: 如何将ppt幻灯片转换为php中的jpeg图像

    下一篇: OSGI集成测试和代码覆盖