Run JUnit Test suite from command line

后端 未结 4 1113
无人及你
无人及你 2021-01-12 19:33

How do I run a Junit 4.8.1 Test suite from command line ? Also I want to use the categories introduces with JUnit 4.8 , is there a way where I can specify from command line

4条回答
  •  余生分开走
    2021-01-12 19:59

    In 4.10, we do this:

    mvn verify -p(your profiles) -Dit.test=(SuiteClass)
    

    where SuiteClass is an empty class (no methods or fields) that is annotated with @RunWith(Categories.class) and @Suite.SuiteClasses({FooIT.class, BarIT.class, ...}). FooIT and BarIT are the integration tests.

提交回复
热议问题