【发布时间】:2017-07-14 06:50:17
【问题描述】:
我刚刚升级了我的解决方案以使用 JUnit5。现在尝试为我的测试创建具有两个标签的标签:@Fast 和 @Slow。首先,我使用下面的 maven 条目来配置使用我的默认构建运行哪个测试。这意味着当我执行mvn test 时,只会执行我的快速测试。我假设我可以使用命令行覆盖它。但我不知道我会输入什么来运行我的慢速测试......
我假设类似....mvn test -Dmaven.IncludeTags=fast,slow 这不起作用
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<properties>
<includeTags>fast</includeTags>
<excludeTags>slow</excludeTags>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.0-M3</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.0-M3</version>
</dependency>
</dependencies>
</plugin>
【问题讨论】:
-
它对我也不起作用。我在 githup 中的代码如下链接:github.com/anhtv08/junit5-splitting-test