Bug 119177 - [JUnit] Let JUnit Test Suite wizard detect nested TestCases
Summary: [JUnit] Let JUnit Test Suite wizard detect nested TestCases
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-03 14:06 EST by Albert Strasheim CLA
Modified: 2006-06-06 08:18 EDT (History)
0 users

See Also:


Attachments
JUnit Test Suite wizard detect nested test classes patch version 0 (3.57 KB, patch)
2005-12-03 14:11 EST, Albert Strasheim CLA
no flags Details | Diff
Test code for these changes (2.61 KB, application/zip)
2005-12-03 14:16 EST, Albert Strasheim CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Strasheim CLA 2005-12-03 14:06:28 EST
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.
Comment 1 Albert Strasheim CLA 2005-12-03 14:11:02 EST
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
Comment 2 Albert Strasheim CLA 2005-12-03 14:11:47 EST
Created attachment 31095 [details]
JUnit Test Suite wizard detect nested test classes patch version 0
Comment 3 Albert Strasheim CLA 2005-12-03 14:16:25 EST
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.
Comment 4 Albert Strasheim CLA 2005-12-03 14:40:13 EST
Whoops, this patch is against Eclipse 3.2 M3, not M2.