只能按文件名在项目中运行某些junit测试 [英] Running only certain junit tests in a project by file name
问题描述
所以我有一个eclipse项目,一堆junit测试文件。我想要运行它们,除了具有一定后缀(或相反地,只有那些具有一组后缀)的人。
So i have an eclipse project, with a bunch of junit test files. I want to run all of them, except ones that have a certain suffix (or inversely, only those that have one of a set of suffixes).
例如,我可以在maven中做这个我可以在一个项目中运行所有测试,这个项目是以Test结尾的文件,所有其他文件都被忽略。
Eg, i can do this in maven; i can run all tests in a project that are in files that end in "Test", and all other files are ignored.
我想在eclipse中做类似的事情/ o必须配置东西;只是根据名字。现在我会去运行配置..,然后选择在选定的项目中运行所有测试,但它会运行在那里发现的一切;我想基于它们的后缀省略文件。
I want to do something similar in eclipse w/o having to configure things; just based on names. Right now i would go to "run configurations.." and then select "run all tests in a selected project..", but it'll run everything it finds in there; i want to omit files based on their suffix.
有没有办法在eclipse中执行此操作?
Is there a way to do this in eclipse?
推荐答案
有几个选项:
- 使用 cpsuite
- 从您的构建路径中排除它们
- 创建一个测试套件,如此或此
- Use cpsuite
- Exclude them from your build path
- Create a test suite like this or this
这篇关于只能按文件名在项目中运行某些junit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!