Hello,

When running pax-exam tests, I find most of my failures are caused by
bundles failing to start for one reason or another. I have two strategies
for figuring out the issues, but I don't think either is quite what I'm
supposed to be doing:

(1) Exhaustive assertion approach: In my test code, I add assertions that
all of the bundles I care about are started. If a bundle isn't started, I
try and start it and use the error message as the message for a test
failure. This makes for tests with very clear failure messages, but it
means writing a lot of boilerplate code. If I forget to add an assertion
for a problem bundle, my system is still a black box, and I need ...

... (2) Sneaky backdoor console approach: Often, what I really want to do
is just open a console to the test framework and have a good browse of
what's started and what's not and which packages and services are
available. In these cases, I find the temporary folder pax-runner is using
and fire up a console using a command like

             java -jar bundles/org.eclipse.osgi_3.5.1.R35x_v20090827.jar
-console -configuration equinox/

This makes it really easy to diagnose what's gone wrong in a failing
system, but it doesn't feel like I'm using the pax tools as intended.

Am I missing some elegant debugging technique that everyone else using
pax-exam knows about? In other words, is there a cleaner way to produce a
dump of which bundles failed to resolve for technique (1), or to easily
bring up a console of the test environment for technique (2) using proper
pax-runner, rather than just ferreting out pax-runner's temporary folders
and using them directly?

Thanks,
Holly
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to