Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This pages describes also a tutorial. With the archive tutorial, a preconfigured version of Felix (with the test framework already installed) is provided.

Working principles

Image.Image Added

The goal of unitary tests in an OSGi context is to check that the bundles (the OSGi deployment units) to test are correctly deployed, that they expose the expected services and that these services work properly. Tests are placed in a bundle, which is deployed in the OSGi environment to test. Then, they can interact with the environment (more specifically bundles and services) to check that everything works well.

...

  • You can use the JUnit4OSGi immediate-runner, which run tests contained in all the test-bundles. The results are displayed in the framework console output.
  • The JUnit4OSGi Felix Command (available only for the Apache Felix OSGi framework), allows you to run tests contained in a specific bundle. Test results are also displayed in the framework console output. The syntax of the command is very simple :
    • To run tests contained in the bundle with the given id :{{
      No Format
      junit <bundle id>
      }}
    • To run tests contained in all the test-bundles installed in the framework :junit all
  • The JUnit4OSGi Swing GUI lets you select the test cases and test suites to execute and shows you graphically the result of the tests. You can double-click on a test case result to show its details.

Image.Image Added

TestCase, TestSuite

...