如何使用 RunWith 指定一套测试方法?
我有类似以下内容:
@RunWith(AllTestsRunner.class)
public class AllTests {
}
其中 AllTestsRunner 是一个套件,它将返回与 AllTests 相同的包中的所有测试类。这工作得很好,但我希望有更细粒度的控制,而不仅仅是指定测试类是什么;我希望能够指定要运行的测试方法(某些测试方法用 @Category(Manual.class)
注释,这些方法不应在持续集成系统中运行) 。是否可以为 AllTests 指定 Runner?
I have something like the following:
@RunWith(AllTestsRunner.class)
public class AllTests {
}
in which AllTestsRunner is a Suite that will return all test classes within the same package as AllTests. This works fine, but I would like to have finer-grained control than to just specify what the test classes are; I would like to be able to specify the test methods to be run (some of the test methods are annotated with @Category(Manual.class)
and these shouldn't be run in the continuous integration system). Is it possible to specify the Runner for AllTests?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用:
Use: