Versions Compared

Key

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

...

Code Block
xml
xml
<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  ...
  <extensions>true</extensions>
  <configuration>
  <instructions>
     ...
      <!-- Declare here the test cases and test suites of your bundle -->
      <Test-Suite>
       a.package.MyFirstTestSuite,
       yet.another.package.MySingleTestCase
       ...
      </Test-Suite>
  </instructions>
  </configuration>
</plugin>

With _ the _ aQute _ Bnd _ Ant _ task, add _ the _ following _ lines _ in _ your _ project _ bnd _ file:

Code Block
Test-Suite: a.package.MyFirstTestSuite, yet.another.package.MySingleTestCase, ...

Quick

...

examples

The following examples show you how to perform unitary tests on your OSGi platform. The first example recovers the example given in the JUnit Cookbook, "bundlizes" it so tests can be run in an OSGi environment. None of the JUnit4OSGi specific features is used, but it shows how to adapt classic JUnit tests. The second example is more OSGi-oriented, and shows how a unitary test can access to the framework via its bundle context.

...