Creating multithreaded tests for JUnit
Sometimes (I hope) you discover code you've written that was not as thread safe as you thought it was. Testing this can be quite a painful experience. I just found this article on Java World describing ways to create JUnit tests in a multithreaded environment. Looking at the date it was published, the article is quite old, so I was wondering if maybe there are better techniques than those described in the article.
Comments
I would suggest either using JUnitPerf http://clarkware.com/software/JUnitPerf.html
or switching to TestNG which is waaaay better than JUnit (even of JUnit4). TestNG supports natively this feature with the -parallel option.