2015-04-04 40 views
2

在大多数广泛使用Spring的项目中,有一些测试使用@IfProfileValue将其标记为集成测试,性能测试或类似测试。当你使用Maven运行这些你做这样的事情:IntelliJ @IfProfileValue默认值

mvn install -Dperformance-test=true 

的注释是这样一类:

@IfProfileValue(name = "performance-test", value = "true") 

但是,如果我在的IntelliJ运行这个测试,我得到:

Test '.Tests in Progress.MyTest' ignored 

我可以在IntelliJ中注释掉注释,但我更喜欢如果测试刚刚运行而不必删除该行,所以我不会意外地提交/推送没有标记的类。

这可能吗?

回答

4

编辑运行配置并将参数-Dperformance-test=true 设置为VM选项。

查看IDEA Run Config了解详细信息。