在 intellij 中运行特定的命名 junit 4.8 测试

发布于 2024-09-08 22:18:51 字数 93 浏览 2 评论 0原文

我正在使用 junit 4.8 和 intellij 8,我只想在 IDE 中运行测试,其名称类似于 *UnitTest.java。

如何才能实现这一目标?

I am using junit 4.8 and intellij 8 and i would like to only run tests inside the IDE which are named something like *UnitTest.java.

How can this be achieved?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋日私语 2024-09-15 22:18:51

找到了 cpsuite 的解决方案。 http://www.johanneslink.net/projects/cpsuite.jsp

可惜不是在 Maven 仓库中。

import org.junit.extensions.cpsuite.ClasspathSuite;
import org.junit.runner.RunWith;

@RunWith(ClasspathSuite.class)
@ClasspathSuite.ClassnameFilters(".*UnitTest")
public class UnitTestSuite {
}

Found a solution with cpsuite. http://www.johanneslink.net/projects/cpsuite.jsp

Pitty it's not in the maven repo.

import org.junit.extensions.cpsuite.ClasspathSuite;
import org.junit.runner.RunWith;

@RunWith(ClasspathSuite.class)
@ClasspathSuite.ClassnameFilters(".*UnitTest")
public class UnitTestSuite {
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文