How to run individual test in the integration-test target in maven

后端 未结 6 1418
囚心锁ツ
囚心锁ツ 2020-12-23 21:36

We have a hundreds of tests defined for our integration-test phase lifecycle in maven, and they take a long time to finish.

What I want to do is run just one test in

6条回答
  •  暖寄归人
    2020-12-23 22:06

    I'm not sure about JUnit, but for TestNG the strategy would be to define a suite XML file with only the one test, and then in your POM configure the surefire plugin to only run that. In your POM, you would have something like this (disclaimer, this is untested):

      
        maven-surefire-plugin
        
          
            integration-test
            
              
                single-test.xml
              
            
            
              run
            
          
        
      
    

    To configure the suite file, see http://testng.org/doc/documentation-main.html

提交回复
热议问题