How to run a unit test with multiple threads in a java project? ide is intellij?.

as mentioned in the question, how does the java project run the unit test with multiple threads? ide is intellij?. Whether to use junit or testng, how to set the parameters? Is there any good way to run unit test case in parallel?


you can implement

with maven's surefire plug-in.
        <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
                <configuration>
                    <parallel>classes</parallel>                
                    <threadCount>5</threadCount>
                </configuration>
      </plugin>          

the general problem encountered by multi-thread running single test is that the child thread is still running after the main thread is executed, but the single test ends without getting the result.

so in essence, you only need to tell the main thread after the child thread has finished execution, and the main thread can wait until then.

if it is a thread pool, you can do this:

  in-depth understanding of inter-thread communication  

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bec040-31ae1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bec040-31ae1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?