Running single test class or group with Surefire and TestNG

前端 未结 4 1940
忘了有多久
忘了有多久 2021-02-14 09:10

I want to run single test class from command line using Maven and TestNG

Things that doesn\'t work:

mvn -Dtest=ClassName test

I have de

4条回答
  •  Happy的楠姐
    2021-02-14 09:49

    As I've explained in question, any mention of groups either in pom.xml or on command line resulted in reduction of executed tests count. Only way I've managed to avoid this is by using mavens profiles like this:

    
        
            test-slow
            
                
                    
                        maven-surefire-plugin
                        
                            slow
                        
                    
                
            
        
    
    

    and then running tests with

    mvn -P test-slow test
    

提交回复
热议问题