Eclipse - When I build the JUnit Suite, the list of test classes is empty. What for?
I have a package with 4 test classes. I want to do JUnit Test Suite. So in Eclipse I right click my package andNew > Other > JUnit Test Suite
The wizard has a warning that "Warning: No test classes selected" and the list is Test Classes to include in suite:
empty.
I'm not sure why. I have several Test.java classes with methods public
annotated with @Test
. I created them with a wizard JUnit Test Case
...
I've seen some code in other Stack Overflow answers that I could use to create a test suite, but why doesn't it work in the IDE?
Should I even worry about the test suite? It seems I can just right click the package and Run As > JUnit Test
.
source to share
Have you chosen the right package from the menu New -> Other > JUnit Test Suite
? After selecting a package using the Browse ... button, you should see your test classes.
You can run all tests directly with help Run As > JUnit Test
in the project, but if you have a lot of test classes, it is recommended to use a test suite to rearrange them (for example, slower tests, tests for a specific part of the program, etc.).
Take a look at this post to learn more about JUnit test grouping.
source to share