Thanks for the mention of GroboUtils. I'm off to explore it a bit. It really is a bit of a shame that there's so much duplication in this arena. A couple of years ago I had written a TestDecorator to handle JUnit tests that need to spawn their own threads. I submitted it to the junit project and it's been in limbo ever since. I think it's actually a bit simpler than the solution here. My decorator can be found at http://sourceforge.net/tracker/index.php?func=detail&aid=535058&group_id=15278&atid=315278
As a decorator it doesn't require the user to modify
what Test class to extend nor the TestRunner to use. It does its magic via a custom ThreadGroup implemented by the decorator, which the test class specifies in it's suite method.
I've also submitted this to the junit-addons project: http://junit-addons.sourceforge.net but I can't seem to find it there now. |