Skip to content

Commit

Permalink
TestingBundles documentation mini update
Browse files Browse the repository at this point in the history
Very small change, which basically only tooks a long sentence in an
easier to consume list.

(cherry picked from commit 604fc4e)
  • Loading branch information
vogella authored and laeubi committed Nov 22, 2023
1 parent 2795ac6 commit 47f526e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/site/markdown/TestingBundles.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
## Testing Bundles / Plugins with Tycho

There are different ways to test Bundles / Plugins with Tycho:
There are different ways to test bundles / plug-ins with Tycho:

### maven-surefire-plugin

Using [maven-surefire-plugin](https://maven.apache.org/surefire/maven-surefire-plugin/) is the preferred way whenever you want to write a plain unit-test,
that is one that either don't need a running OSGi, use some kind of mocking technique (e.g. [Apache Sling OSGi Mocks](https://sling.apache.org/documentation/development/osgi-mock.html))
or starts an embedded OSGi Framework (e.g. [osgi-test-framework](https://github.com/laeubisoft/osgi-test-framework)).
Using [maven-surefire-plugin](https://maven.apache.org/surefire/maven-surefire-plugin/) is the preferred way whenever you want to write a plain unit-test.
This is a unit test that either:

* don't need a OSGi runtime
* use some kind of mocking technique for OSGi (e.g. [Apache Sling OSGi Mocks](https://sling.apache.org/documentation/development/osgi-mock.html))
* or starts an embedded OSGi Framework (e.g. [osgi-test-framework](https://github.com/laeubisoft/osgi-test-framework)).

This requires:
- setting up your project using a test-source folder (see below), alternatively using the [standard maven layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
Expand Down Expand Up @@ -37,7 +40,8 @@ A sample snippet looks like this:
</project>
```

To execute the tests, one has to invoke maven with `mvn test`, the following demo projects are provided as an example:
To execute the tests, one has to invoke maven with `mvn test`.
The following demo projects are provided as an example:

- Project with a configured source folder: https://github.com/eclipse-tycho/tycho/tree/master/demo/testing/surefire/with-source-folder
- Project using maven standard layout: https://github.com/eclipse-tycho/tycho/tree/master/demo/testing/surefire/with-maven-layout
Expand Down

0 comments on commit 47f526e

Please sign in to comment.