Running only certain junit tests in a project by f

2019-02-22 06:11发布

问题:

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


标签: eclipse junit