Running only certain junit tests in a project by file name

心已入冬 提交于 2019-12-30 19:26:10

问题


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).

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.

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.

Is there a way to do this in eclipse?


回答1:


There are several options:

  • Use cpsuite
  • Exclude them from your build path
  • Create a test suite like this or this


来源:https://stackoverflow.com/questions/10489838/running-only-certain-junit-tests-in-a-project-by-file-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!