Maven Surefire:进行单个单元测试(Maven Surefire: run a single unit test)

编程入门 行业动态 更新时间:2024-10-26 10:32:47
Maven Surefire:进行单个单元测试(Maven Surefire: run a single unit test)

我知道可以使用-Dtest=MyTest运行特定的测试类。 但是可以该类中运行特定的测试吗?

即如果MyTest定义了testFoo()和testBar() ,有没有办法指定只应运行testfoo() ?

我知道在IDE中执行此操作非常简单,但我偶尔需要在另一台服务器上的命令行上运行测试。

I know that it's possible to run a specific test class with -Dtest=MyTest. But is it possible to run a specific test within that class?

I.e. if MyTest defines testFoo() and testBar(), is there a way to specify that only testfoo() should be run?

I'm aware that it's trivially easy to do this in an IDE, but I occasionally need to run tests on the command line on another server.

最满意答案

它将从Surefire 2.8开始提供,请参阅SUREFIRE-577

It will be available as of Surefire 2.8, see SUREFIRE-577

更多推荐

本文发布于:2023-08-04 20:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1421978.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元测试   Surefire   Maven   run   test

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!