Activate Declarative Services with Pax Exam 3.X

304 Views Asked by At

Currently I'm using Pax Exam 3.X (Native container: apache.felix.framework) to test an OSGi application.

I'm trying to start the declarative services automatically, but I can only start them calling the activate() method explicitly inside every test.

Is there another way to activate the declarative services?

Many thanks.

3

There are 3 best solutions below

0
On BEST ANSWER

Have a look at DeclarativeServicesTest in the Pax Exam integration test suite for a working example.

0
On

Looks like you need some sort of Extender to start your DS bundles. Maybe you just need to add something like Felix-SCR in your Pax Exam configuration? At least that how it works if you have blueprint bundles in your test, you'll need some sort of blueprint framework to start your blueprint bundles.

0
On

I have to adapt my code. I've introduced Felix-SCR, but I'm continuing working on. Many thanks to hwellmann and Achim Nierbeck for your time.