Bug 312204 - [api][JUnit] Allow changing the default superclass in NewTestCaseWizardPageOne
Summary: [api][JUnit] Allow changing the default superclass in NewTestCaseWizardPageOne
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
: 188983 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-10 00:49 EDT by Kris De Volder CLA
Modified: 2013-02-01 10:30 EST (History)
2 users (show)

See Also:


Attachments
A patch against version checked out from HEAD on Sun May 9th, 2010. (1.23 KB, patch)
2010-05-10 00:56 EDT, Kris De Volder CLA
no flags Details | Diff
Update patch, better commenting / JavaDocs (1.88 KB, patch)
2010-05-10 11:53 EDT, Kris De Volder CLA
no flags Details | Diff
Updated patch, better comments / JavaDoc (1.88 KB, patch)
2010-05-10 12:00 EDT, Kris De Volder CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kris De Volder CLA 2010-05-10 00:49:00 EDT
Build Identifier: 20100506-2000

Groovy Eclipse is subclassing from NewTestCaseWizardPageOne to create JUnit wizard for Groovy.

It is hard to change the default superclass used for a JUnit3 style testcase. Using setSuperClass doesn't quite work because there is a call to a private method  "internalSetJUnit4" which will reset it when a user clicks the JUnit radio buttons.

I've attached a patch with a proposed solution that makes a minimal change NewTestCaseWizardPageOne class. The change is behavior preserving, but it delegates the choice of the default superclass for JUnit 3 tests to a protected method which can easily be overriden.

Reproducible: Always

Steps to Reproduce:
NA
Comment 1 Kris De Volder CLA 2010-05-10 00:56:07 EDT
Created attachment 167657 [details]
A patch against version checked out from HEAD on Sun May 9th, 2010.
Comment 2 Markus Keller CLA 2010-05-10 09:02:27 EDT
Looks good, but unfortunately, we're past the API freeze for 3.6. Could you please attach a new patch with these changes for 3.7?

- fix Javadoc: add @since 3.7, add @return, use wording that is more similar to other Javadocs (i.e. "Clients can override [to]...").

- fill out this template and add it to the header comment:
Your Name <email@example.com> - Bug Title - https://bugs.eclipse.org/BUG_NUMBER
Comment 3 Kris De Volder CLA 2010-05-10 11:53:07 EDT
Created attachment 167737 [details]
Update patch, better commenting / JavaDocs
Comment 4 Kris De Volder CLA 2010-05-10 12:00:40 EDT
Created attachment 167740 [details]
Updated patch, better comments / JavaDoc

Oops my "167737" patch file had a little mistake.
Comment 5 Markus Keller CLA 2010-06-22 11:52:38 EDT
Thanks for the patch, fixed in HEAD.
Comment 6 Markus Keller CLA 2013-02-01 10:30:19 EST
*** Bug 188983 has been marked as a duplicate of this bug. ***