Bug 230469 - [patch] New Plug-in Test Fragment Project Wizard proposal
Summary: [patch] New Plug-in Test Fragment Project Wizard proposal
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.2   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: bugday, noteworthy
Depends on:
Blocks:
 
Reported: 2008-05-06 15:29 EDT by Sudhakar Ramasamy CLA
Modified: 2019-11-27 07:35 EST (History)
5 users (show)

See Also:


Attachments
Starting patch - changes in the GUI (5.18 KB, patch)
2008-11-03 09:51 EST, Jakub Jurkiewicz CLA
no flags Details | Diff
Patch (6.41 KB, patch)
2008-11-04 12:05 EST, Jakub Jurkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sudhakar Ramasamy CLA 2008-05-06 15:29:56 EDT
I constantly find myself needing to create new fragment projects to test plugins that I develop for RCP applications.

Right now this a manual process consisting of

1. Launch the New Fragment Project wizard
2. Enter the host plugin name
3. Move the newly created Fragment project to my working set in Package Explorer
4. Add a dependency on org.junit4
5. Create the AllUnitTests.java class

Is there a way to define a new Project Wizard "Plug-in Test Fragment Project" that will automate as much of the above actions? 

One way I can think of is right-click the plugin project under test and say "Create new test fragment" to launch this wizard. Also, this should ideally support both JUnit and TestNG.

Thanks
-sud
Comment 1 Chris Aniszczyk CLA 2008-05-06 15:34:11 EDT
cool idea, will think about this in 3.5
Comment 2 Chris Aniszczyk CLA 2008-08-12 10:59:26 EDT
This sounds like a great candidate for bugday.
Comment 3 Jakub Jurkiewicz CLA 2008-10-27 08:39:18 EDT
Chris if you could help with this I would try to resolve this.
Comment 4 Chris Aniszczyk CLA 2008-10-28 11:52:10 EDT
Ok, here is my suggestion :)

Modify the second page of the fragment wizard (org.eclipse.pde.internal.ui.wizards.plugin.FragmentContentPage) and add a new "Options" section that has a checkbox to make a test fragment and allows you to choose between Junit3/4

Does that sound like a start?

Thanks for looking into this Jakub and sorry for the delay!
Comment 5 Chris Aniszczyk CLA 2008-10-28 11:52:30 EDT
btw, we can target to get this in for M4 :)
Comment 6 Jakub Jurkiewicz CLA 2008-11-03 09:51:46 EST
Created attachment 116813 [details]
Starting patch - changes in the GUI

Patch with the changes if the UI in the second page of the new fragment wizard. 
Chris, could you have a look?

I guess that after clicking Finish the wizard should ask about adding JUnit 3/4 to the classpath (like in the new JUnit Test Case wizard), right? Or do you have some other ideas for the next step Chris?
Comment 7 Chris Aniszczyk CLA 2008-11-03 10:07:46 EST
The patch is a start.

I would create a group called "Options" instead of "JUnit Options"

I would also add a checkbox, "Create a test fragment" (not enabled by default) and give it the option of Junit 3 or Junit 4. This workflow should be similar to how we add working sets to a fragment (on the first wizard page).

Let me know if you need anymore help. Great start though!
Comment 8 Jakub Jurkiewicz CLA 2008-11-04 12:05:08 EST
Created attachment 116970 [details]
Patch

Thanks Chris for a quick response!
I prepared an update, so please have a look - I'm looking forward for your comments and any suggestion what we want to do next.
Comment 9 Chris Aniszczyk CLA 2008-11-06 19:16:58 EST
Looks fine.

Now, you're going to have to look at org.eclipse.pde.internal.ui.wizards.plugin.NewProjectCreationOperation and modify it to handle the case of this new property. It also looks like you need to modify FragmentFieldData to be aware if a fragment is setup to be a JUnit one.

Does that help for a start?
Comment 10 Chris Aniszczyk CLA 2008-11-10 15:27:58 EST
Let me know if you need anymore help Jakub.
Comment 11 Jakub Jurkiewicz CLA 2008-11-12 05:33:15 EST
i will try to find some time this week to have a look and work on this.
Comment 12 Jakub Jurkiewicz CLA 2008-11-17 08:17:41 EST
I've spent some time today analyzing the code and I wonder if we want to make this wizard similar to the 'New JUnit Test Case" one (additional window asking to add the junit library to the build path or not)? or do we want to add the library silently? If we want to follow the first approach then I guess that the code from NewTestCaseCreationWizard could be used.
Chris, could you comment?
Comment 13 Chris Aniszczyk CLA 2008-11-30 14:59:08 EST
ping
Comment 14 Jakub Jurkiewicz CLA 2008-12-08 10:08:01 EST
(In reply to comment #13)
> ping
> 

Chris, in comment #11 I asked about our further directions. Could you have a look and comment?
Comment 15 Darin Wright CLA 2009-04-15 09:49:00 EDT
Removing 3.5 milestone unless some one intends to look at this.
Comment 16 Chris Senior CLA 2011-05-25 10:16:02 EDT
What are the chances of resurrecting this feature? I have tried doing something similar as an external plugin and it sucks bad (PDE wizards don't like being extended).
Comment 17 Lars Vogel CLA 2019-11-27 07:35:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.