Community
Participate
Working Groups
In Eclipse 3.2M2, the JUnit Test Suite can detect classes that extend junit.framework.TestCase and can add them to a generated test suite runner. However, if these classes are nested inside another class, the wizard does not detect them. For example: public class Foo { public static class Test { // ... } } The wizard should detect these classes and make the necessary changes to the generated test suite runner so that they are included. I have a patch to do this. Hopefully I can attach it after submitting this feature request.
I will attach the first version of my patch after this. Summary of the changes required: - SuiteClassesContentProvider was modified to check inside types for more classes that could be test implementors - UpdateTestSuite was modified to use the type qualified name separated with periods when generating the test suite runner - The label provider used to display the list of tests was changed to show the qualified name of the test classes
Created attachment 31095 [details] JUnit Test Suite wizard detect nested test classes patch version 0
Created attachment 31096 [details] Test code for these changes This test code includes a bunch of classes that extend TestCase in various configuration to show that the wizard works as expected and detects the nested test cases. A test that can be run against the generated test suite runner is also included. It checks that the correct number of tests are added to the suite.
Whoops, this patch is against Eclipse 3.2 M3, not M2.