How can I run all JUnit tests in one package @ Net

2019-06-06 09:34发布

问题:

I have like trillion test packages with bazillion tests and I want to run just some of packages. Now I must run whole project (some tests takes long to complete) or I need to run every single file manually. How is possible to run just some packages in NetBeans ? I can't find this option ...

回答1:

It's probably not what you want, but the NetBeans help topic, Running a JUnit Test, says:

If you want to run a subset of the project's tests or run the tests in a specific order, you can create test suites that specify the tests to run as part of that suite. After creating a test suite you run the suite in the same way you run a single test class.

Creating a test suite is covered in the topic Creating a JUnit Test.



回答2:

If you use JUnit 4 then try ClasspathSuite and its regex filters.