This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Test case with multithreads

 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • 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
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Lasse and Andy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic