Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUnit, test and threads

when i run multiple JUnit tests in a row, does JUnit create a new thread for each execution or everything is wrapped in a single thread?

Thanks

like image 942
Mark Avatar asked Feb 27 '23 01:02

Mark


1 Answers

It's all on a single thread. You don't say how you're invoking the tests, but for example, running a TestSuite will run all the tests in the suite sequentially.

If you want parallel execution, TestNG has support for running tests concurrently, as does JUnitPerf and GroboUtils.

like image 158
mdma Avatar answered Mar 07 '23 02:03

mdma