How to tell Maven2 to execute jUnit tests one by one each in new JVM instance?

前端 未结 3 1652
夕颜
夕颜 2020-12-15 23:13

Is it possible to tell Maven2 to execute every jUnit test in new JVM instance (fork) in serial mode, i.e. one by one.

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 23:55

    Well i tried these responses but what i just got was several test functions of a same JUnit test running at the same time. For creating a JVM for each JUnit Test files (what i needed) you must use the folowing configuration (The difference it the parallel parameter):

        
            org.apache.maven.plugins
            maven-surefire-plugin
            2.9
             
                classes
                false
                 
                    **/*Test.java     
                 
            
        
    

    Replace the mattern **/*Test.java for one that matches those JUnit Tests that must run in different JVMs. For more information visit: Combining forkCount and parallel.

提交回复
热议问题