Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JUnit Threads still running after test ends

 
Zeki Karaca
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I need some advice/help. I have a test suite as follows:



A test abstraction class:



A test as follows:



When i test this by running the test suite, a few threads are started in eclipse. After my test ends, these thread are still running. When i want to test again, again a few threads are started and this keeps going on and slows down the whole system everytime i try to test. Why are these threads not stopped? Should i use tearDown() to do this manually somewhere? Any help would be appreciated.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to stop your Selenium.
 
Zeki Karaca
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And where would i do that? In a tearDown() method? If so, where? I have 3 different classes, as seen above (all extend TestCase (in)directly).
 
Zeki Karaca
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Selenium RC with Java. Part of my code is here:



The selenium session is not killed! Selenium.stop() is not working? See generated output:

starting
com.thoughtworks.selenium.DefaultSelenium@1abc7b9
stopping
alive
com.thoughtworks.selenium.DefaultSelenium@1abc7b9


As i told before, some of the threads that are started are still running. What am i doing wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic