I write a parameterized junit test.
Is there any built-in way to make it run in parallel? any @annoation
for example?
If not, and my only way is to write this manually -
how would you manage a thread pool in junit, java?
With the specification of the CONCURRENT execution mode annotations, the parameterized tests defined in each of the inner classes will be run in parallel thus achieving the desired goal.
Once the parallel execution property is set (or enabled), the JUnit Jupiter engine will run the tests in parallel as per the configurations provided with the synchronization mechanisms.
A plugin that allows you to run JUnit4 tests in parallel (using multiple CPU cores/threads).
The library JUnit Toolbox provides a ParallelParameterized runner. Replace
@RunWith(Parameterized.class)
public class YourTest {
with
@RunWith(ParallelParameterized.class)
public class YourTest {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With