我刚刚升级了我的解决方案以使用 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>