0

how can I use Junit to do unit testing in Apache Karaf / Fuse?

Red Hat has some documentation on doing so, using pax-exam, but these appear dated and the last version of org.apache.karaf.tooling.testing needed for tests appear to be updated in 2011.

Help?

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
jhtong
  • 1,529
  • 4
  • 23
  • 34

2 Answers2

2

Pax-exam is not outdated, and is still used for karaf and jboss fuse integration tests. You can look at pax-exam documentation, apache karaf integration tests source and apache karaf documentation.

Note that this is designed for integration testing more than for unit testing. Please look at What is the difference between integration and unit tests? for a better understanding of difference between unit and integration tests.

Community
  • 1
  • 1
Alexandre Cartapanis
  • 1,513
  • 3
  • 15
  • 19
1

The apache karaf container for pax exam started in the karaf project. It has now moved to the pax exam project. Pax exam is still the best way to do tests for karaf deployments.

For examples you can look into the karaf integration tests as well as in the karaf tests of Apache CXF or Apache Camel.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64