Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{include:apache-felix-ipojo-header}
{html}
<div class="content">
{html}
h1. junit4osgi framework architecture

_This page describes the architecture of the junit4osgi framework._

{div:class=toc}
{toc:maxLevel=4|minLevel=2}
{div}

h2. Global architecture

!junit4osgi-arch.png|align=center, width=50%, height=50%!

A system tested with junit4OSGi is divide in three parts:
# The tested system composed by bundles/services/... composing the system under tests. This can be the {{true}} application.
# Tests bundles containing tests stressing/checking the system under tests.
# The junit4OSGi framework composed by a runtime bundle (executing tests) and a runner bundle (launching test). 

junit4OSGi does not impacts anything on the system under test. Test bundles interact with the system under test via services/events ... Bundle containing tests declared contained test suites in there {{manifest}} such as:
{code}
Test-Suite: org.apache.felix.ipojo.test.scenarios.ps.ProvidedServiceTestSuite, org.apache.felix.ipojo.scenarios.ps.StrategyTestSuite
{code}

Thanks to this {{manifest}} header, the junit4OSGi runtime bundle collects tests. This bundle is the core of the test framework, and manage both collection and execution of tests. The runner bundle just launch tests. According to the runner implementation, test selection can also be done. Several runner have been developped:
* junit Felix command: executing test from the Felix shell (only for Felix)
* Swing runner: executing test from a Swing application (works for Felix, Equinox and Knopflerfish)
* Immediate runner: executing test as soon the runner arrives in the framework (works for Felix, Equinox and Knopflerfish)
* Maven runner: launching an embedded Felix with required bundle and launching test automatically during the Maven build process.

h2. Why junit 3 ?

The junit4OSGi framework use junit 3 because it was design and developed to test embedded systems. So, the junit4OSGi framework runs on a J2ME Foundation Profile 1.1 virtual machine (such as Mika). However, soon, junit4OSGi will evolve to support junit4Junit4 and TestNG.
\\
\\
{include:apache-felix-ipojo-footer}