Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-ui-dev] Extending the JUnit test creation wizard


You should be able to extend 'NewTestCaseWizardPageOne' and 'NewTestCaseWizardPageTwo' without requiring to access internal fields.
The idea is that you reimplement 'createControl', and pick and choose to controls you need and add your own controls.
Reimplement 'getStatusList'  to change the validation.
Reimplement 'createTypeMembers' to change the generated code.

It also is worth considering inheriting from 'NewTypeWizardPage' without trying to reuse the JUnit wizards.  If you have suggestions what to make API or where to add more reusable components, file a bug. From my experience, UI code is difficult to reuse as the code is tailored for specific needs of a given UI. For example you should not try to reuse label strings or validation messages for wizard that are not doing the same.

Martin




"Ted Velkoff" <ted@xxxxxxxxxxx>
Sent by: jdt-ui-dev-bounces@xxxxxxxxxxx

24.11.2007 15:03

Please respond to
"Eclipse JDT UI developers list." <jdt-ui-dev@xxxxxxxxxxx>

To
<jdt-ui-dev@xxxxxxxxxxx>
cc
Subject
[jdt-ui-dev] Extending the JUnit test creation wizard





I would appreciate some advice regarding the best approach to extending the JUnit test creation wizard.  I am the author of the SpringUnit test framework (http://sourceforge.net/projects/springunit), for which an Eclipse plug-in I wrote facilitates the creation of new test cases.
 
This task proved to be very unsatisfying because 1) it seemed require accessing internal fields and methods not meant for extension; 2) it took six weeks of spare-time effort to accomplish; and 3) it resulted in a buggy product sensitive to the order in which the user chooses to enter data in fields.  The first iteration supported JUnit3; I now want to extend it to support JUnit4.  Before (if) I undertake this, I seek input from the Eclipse plug-in development community about the best way to proceed.
 
Am I correct that many of the extension points I need are currently unavailable for extension?  If so, can these be opened up?  Is there any possibility that the code base can be refactored into smaller, more-understandable components?  In general, what steps can I take, and what help is available to me?
 
Thanks in advance.
 
Ted Velkoff
 _______________________________________________
jdt-ui-dev mailing list
jdt-ui-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-ui-dev


Back to the top