From: Jeffrey C. <jc...@ac...> - 2007-05-07 16:18:38
|
Folks, =20 I have a large body of test cases that ideally I'd like to run in multiple threads. In JUnit 3.8 I see javadoc for a multithreaded test suite junit.extensions.ActiveTestSuite. I don't see anything analogous in JUnit 4. It seems that in JUnit 4 this really needs to be done as a Runner. =20 I got rough modified versions org.junit.internal.runners.CompositeRunner and org.junit.runners.Parameterized working in multithreaded mode, using a pool of threads to run each test returned by the @Parameters method in a thread. =20 I see a possible thread safety problem in org.junit.runner.notification.RunNotifier. If a listener throws an exception, the notifier tries to remove it from the listener collection. I am not sure but I think that this might cause problems when multithreaded. (I've never had a listener throw, however.) =20 I am planning to look at multithreaded versions for some of the other runners. If anyone else has ideas or is already doing this, please let me know? =20 =20 Thanks, Jeff Clary =20 |