Java JUnit框架里@Category注解的工作原理

  1. 云栖社区>
  2. 汪子熙>
  3. 博客>
  4. 正文

Java JUnit框架里@Category注解的工作原理

jerrywangsap 2020-05-07 20:25:41 浏览420
展开阅读全文

Suppose you have a large number of unit test cases and you don’t want them to be executed all at the same time during Maven build. You can simply achieve it via annotation @Category.

(1) Create empty class FastTests and SlowTests.
(2) In your test case class, categorize your test method using @Category annotation:

(3) Append the following code to your pom.xml:

<profile

网友评论

登录后评论
0/500
评论
jerrywangsap
+ 关注
所属团队号: 汪子熙