Community
Participate
Working Groups
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
cool idea, will think about this in 3.5
This sounds like a great candidate for bugday.
Chris if you could help with this I would try to resolve this.
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!
btw, we can target to get this in for M4 :)
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?
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!
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.
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?
Let me know if you need anymore help Jakub.
i will try to find some time this week to have a look and work on this.
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?
ping
(In reply to comment #13) > ping > Chris, in comment #11 I asked about our further directions. Could you have a look and comment?
Removing 3.5 milestone unless some one intends to look at this.
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).
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.