thx, but that's not what I mean. I want it to be automatic, so I can use a tool to do it. Like invoking some method pleaseTellMeIfAllMyBundlesAreDeployedFine. Or even better to be notified (some listener thingie) when it happens.
I don't want to do anything by hand.
You can definitely get all this info via JMX, as an example connect jconsole to servicemix and you'll see there's an osgi.core mbean. With this mbean you can browse what bundles are deployed, query their states, etc. Using JMX though would the require you to poll this mbean on a regular basis to get the kind of notifications you're looking for.
My two cents (something to try):
1. For the bundles your trying to test register/open them using org.osgi.util.tracker.ServiceTracker.
2. In your test bundle can now use org.osgi.util.tracker.ServiceTracker.waitForService or maybe getTrackingCount().
The General Question is: How do you do a automated/programmic OSGi Service Bundle testing (junit for OSGi)?
1. First wait for the test target bundle(s) to be deployed "active"
2. Run unit tests.
3. Report results.
FUSE ... any suggestions? How to you unit test your product bundles?