我的 Java 项目中有多个配置文件。它们中的每一个都处理独占的请求集。当我为选定的配置文件构建项目时,我想运行仅与该配置文件相关的测试。是否可以使用某种 Junit 或 Maven 配置来完成?
最佳答案
你可以使用 Maven 配置多个配置文件,并且每个配置文件都有自己的 http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#includes
您也可以更改http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#testSourceDirectory或使用http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#groups
关于java - 如何在 Maven 中使用 junit 运行配置文件特定的测试用例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18287208/