Bug 205361 - Refactor project conversion code into an Operation
Summary: Refactor project conversion code into an Operation
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Les Jones CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed, greatbug
Depends on:
Blocks:
 
Reported: 2007-10-03 17:54 EDT by Brian Bauman CLA
Modified: 2007-10-26 12:58 EDT (History)
3 users (show)

See Also:
baumanbr: review+


Attachments
Patch to refactor conversion code out of wizard page into an operation. (22.61 KB, patch)
2007-10-25 05:26 EDT, Les Jones CLA
no flags Details | Diff
Simple Test Case (4.17 KB, text/x-java)
2007-10-25 05:27 EDT, Les Jones CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bauman CLA 2007-10-03 17:54:53 EDT
Currently, the code to convert a project to a PDE project is tied directly to org.eclipse.pde.internal.ui.wizards.tools.ConvertedProjectsPage.  We should be smarter about this and refactor out this code to run as a stand alone operation.  This will aid us in developing junit test cases in the future and help us try to separate our UI and non-UI code.
Comment 1 Les Jones CLA 2007-10-25 05:26:26 EDT
Created attachment 81142 [details]
Patch to refactor conversion code out of wizard page into an operation.

This is a patch that moves the code for converting a project to a plug-in project from the wizard page into an operation. It's a fairly simple refactoring for now, so I've not split up the core and ui code, but for now at least, this is a less risky solution. Hope this is the kind of this you were looking for and is of some use.

Patch was developed on a 3.4 build (I20071023-0800) and has subsequently been successfully reapplied to code pulled from the HEAD.
Comment 2 Les Jones CLA 2007-10-25 05:27:50 EDT
Created attachment 81143 [details]
Simple Test Case

Attached is a simple test case I also created whilst pulling this change together.
Comment 3 Chris Aniszczyk CLA 2007-10-25 10:14:18 EDT
awesome Les!!!!!
Comment 4 Chris Aniszczyk CLA 2007-10-25 10:35:59 EDT
let's make sure this gets in for 3.4 sometime
Comment 5 Les Jones CLA 2007-10-25 11:01:13 EDT
A may be able to give a little more time beefing up the test cases if someone's able to give me some better scenarios. This would then enable us to consider performing a more major refactoring (e.g. ui->core) with a better degree of confidence sometime in the future.

On the subject of test cases, I had a problem when trying to run the test case as part of the org.eclipse.pde.ui.tests plug-in. Got a "no classloader found for plugin org.eclipse.pde.ui.tests" error when the JUnit plug-in launcher tried to execute the tests. Therefore, to run these tests I put the test class in the org.eclipse.pde.ui plugin and (temporarily) altered the manifest to include a dependency on JUnit - obviously, I didn't include this in the patch ;-) 

Should the org.eclipse.pde.ui.tests plugin work? If so, any ideas what the problem might be; if not, where should the test class have been put?
Comment 6 Brian Bauman CLA 2007-10-26 12:48:29 EDT
Nice job Les.  Very good patch.  And I have to say in all my years at PDE I don't think I have ever seen anyone create J-Unit test cases for their contribution.  Thanks for going the extra mile, that definitely helps us out!

If you are interested in being added to the wall of PDE contributors (http://www.eclipse.org/pde/pde-ui/committers/committers.php), please send me a head shot with a leafy back ground :)

Thanks again for a great patch and the J-Unit test cases to make sure we don't break it in the future :)
Comment 7 Chris Aniszczyk CLA 2007-10-26 12:51:32 EDT
I'm marking this one as a greatbug
Comment 8 Les Jones CLA 2007-10-26 12:58:14 EDT
Thanks, but those tests in the supplied test case were pretty simple. We should probably look to add some more in to provide a little more coverage.