File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Test case with multithreads

 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
If a junit test case spawns new threads,
must all the threads terminate before the next test case is called?
Thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this depends on whether these threads are "daemon" or "regular" threads.
 
Andy Hunt
Author
Ranch Hand
Posts: 55
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My memory on this is a little fuzzy, but as I recall JUnit as shipped has (or had) some bugs with regard to handling multiple threads.
There was a patch available from a 3rd party (just a Google away :-) that dealt with threads in a much more robust manner. In the patched version, I believe the answer to your question is "yes."
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Lasse and Andy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic