Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312204

Summary: [api][JUnit] Allow changing the default superclass in NewTestCaseWizardPageOne
Product: [Eclipse Project] JDT Reporter: Kris De Volder <kdevolder>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: bimargulies, markus.kell.r
Version: 3.6Keywords: api
Target Milestone: 3.7 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
A patch against version checked out from HEAD on Sun May 9th, 2010.
none
Update patch, better commenting / JavaDocs
none
Updated patch, better comments / JavaDoc markus.kell.r: iplog+

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. ***