How to run JUnit tests by category in Maven?

前端 未结 8 1871
说谎
说谎 2020-11-28 21:59

Using JUnit 4.8 and the new @Category annotations, is there a way to choose a subset of categories to run with Maven\'s Surefire plugin?

For example I h

8条回答
  •  眼角桃花
    2020-11-28 22:35

    Maven has since been updated and can use categories.

    An example from the Surefire documentation:

    
          maven-surefire-plugin
          2.11
          
            com.mycompany.SlowTests
          
    
    

    This will run any class with the annotation @Category(com.mycompany.SlowTests.class)

提交回复
热议问题