i am trying to run integration tests on a project with GyrexServerResource.
The tests (and the app) are a legacy code.
The problem is that the ApplicationManager is not available.
Here my finding while debugging.
- The application manager should be taken from a custom bundle.
- The custom bundle is available during runtime of the tests.
- The application manager should be bound to the custom bundle on startup: it works on actual server start, but not in test environment.
- The application manager is bound correctly to other components in the test environment.
I dont know where to start to dig and would be glad to get any hint from you.
It sounds to me like an issue with bundle activation, potentially ordering. Keep in mind that the test bundle and all it's dependencies are activated first. Then the JUnit rule is triggered and the server is started. This is different from regular startup when the server is activated before the other bundles.
Can you check if the service is dynamic, i.e. updating to changes in the service registry as the other service becomes available?
Also, I would try launching the tests with -console and then debug bundle activation/resolution status from within. You should set a breakpoint or instruct Equinox to not exit in case of errors. That's also very handy if you are troubleshooting resolution errors.