ops4j / org.ops4j.pax.exam2

Pax Exam is a testing framework for OSGi
https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/
Apache License 2.0
84 stars 100 forks source link

Add an assertion to wait for blueprint contexts to start [PAXEXAM-580] #698

Open ops4j-issues opened 11 years ago

ops4j-issues commented 11 years ago

Christian Schneider created PAXEXAM-580

When using blueprint the bundle state does not really tell the whole story where the bundle is healthy. If blueprint contexts fail to create it only shows indirectly if you inject the provided services.

So it would help a lot to have an assertion that waits on all (or named) blueprint contexts to start. The assertion could also fail with the blueprint error if the context can not be started.

I created a similar reporting for karaf 3 by using the the event admin to catch blueprint the blueprint events.


Affects: 3.3.0 Votes: 0, Watches: 3

ops4j-issues commented 11 years ago

Christoph Läubrich commented

You can always try to fetch the "BlueprintContainer" Service in your test case to make sure the context is started successfull.

ops4j-issues commented 11 years ago

Achim Nierbeck commented

This is far to specific for blueprint, I'd guess you'll need to add some extras to your test case. Most likely as it can be found at the Pax-Web Test where there are extra methods for waiting for a special event telling that the tested service is started.

ops4j-issues commented 11 years ago

Christian Schneider commented

Christoph Läubrich Fetching the BlueprintContainer service is possible and we already do this in a project. The problem with this approach is that in case of a failure you have to wait for the timeout to pass as you are not notified of the failure. You will also not see the cause of the failure in the junit report. So the goal if this issue is to provide a fast and detailed feedback and to provide it in the junit report.

Achim Nierbeck Ideally I would like this to also include DS and spring dm. So in the long run an abstraction layer would make sense.

ops4j-issues commented 11 years ago

Christoph Läubrich commented

The point is: Pax Exam can't detect this problem withou coupling to a specific provider because the BlueprintContainer is the only official interface for this IMO. Just keep in mind that pax exam does not do more than starting the framework in a standard osgi way it does not control Blueprint or any other aspect directly.