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

Bug 201886

Summary: creating TPTP test but you need to have parent project created first.
Product: z_Archived Reporter: jkubasta
Component: TPTPAssignee: Paul Slauenwhite <paulslau>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: heatonkm, paulslau
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Patch. none

Description jkubasta CLA 2007-08-31 08:39:17 EDT
Find that creating a TPTP Test (JUNIT or Manual) as: 
File->New->Other >Test > TPTP JUnit Test
requires that you add to a parent folder that already exists.   If I try to type in a new parent folder, receive message "The specified project does not exist"
Have to cancel.. go create a project, then go and create the TPTP test.
Comment 1 Paul Slauenwhite CLA 2007-10-01 14:40:54 EDT
The user should be presented with a dialog asking if they want to create the project or folder.

This solution should be applied to all wizards and dialogs that create files.
Comment 2 Paul Slauenwhite CLA 2008-01-07 11:51:06 EST
Deferring to I6.
Comment 3 Paul Slauenwhite CLA 2008-03-10 08:36:07 EDT
We can reuse the org.eclipse.hyades.execution.recorder.http.ui.wizards.HttpRecorderNoProjectsPage.java wizard page.  This wizard page should be moved to an internal class in org.eclipse.hyades.test.ui and referenced/sub-classed for the specific wizards.
Comment 4 Paul Slauenwhite CLA 2008-03-31 12:14:08 EDT
Deferring to I7 as discussed by PMC/AG (http://wiki.eclipse.org/TPTP-AG-20080331#Test_Project).
Comment 5 Paul Slauenwhite CLA 2008-04-16 07:07:13 EDT
(In reply to comment #3)
> We can reuse the
> org.eclipse.hyades.execution.recorder.http.ui.wizards.HttpRecorderNoProjectsPage.java
> wizard page.  This wizard page should be moved to an internal class in
> org.eclipse.hyades.test.ui and referenced/sub-classed for the specific wizards.
> 

This wizard should not be reused since:

-Creates only new Java projects containing the URL recordings/test suites and test assets can/should be created in either general, Java, and Plug-in projects.

-Inconsistent with the JDT wizard for creating new Java projects (e.g. programmatically creates only a minimal Java project using JDT API based on a project name).

-Does not allow the user to configure the source folder(s) for the Java project, required when creating a JUnit test suite.

Our requirements for such a wizard include:

-Allows the users to create a general project for Manual tests, as well as artifacts, datapools, deployments, locations, and workbench locations.

-Allows the users to create a Java project with configurable source folder(s) for Manual, JUnit, and URL recordings/tests, as well as artifacts, datapools, deployments, locations, and workbench locations.

-Allows the users to create a Plug-in project with configurable source folder(s) for Manual, JUnit, URL recordings/tests, JUnit Plug-in, AGR, and , as well as artifacts, datapools, deployments, locations, and workbench locations.

To satisfy all of these requirements in a consistent manner, we need to use the create project wizard (File >> New >> Project...).  However, the only public API to invoke this wizard is org.eclipse.ui.actions.NewProjectAction.java, which does not allow the caller to get the name of the newly created project.  This reduces it programmatic use to situations where there is are no open projects in the workspace and the name of the newly created project can be easily derived from th workspace root.

Originally, the design included a link ("Create a new <a>project</a>.") to open the create project wizard at the bottom of the org.eclipse.tptp.platform.common.ui.wizard.LocationPage.java wizard page, since all test assets (except AGR/JUnit/JUnit Plug-in test suites) use this wizard page.  However, after an exhaustive search, there is no API (or kludge for that matter) to update/select the underlying org.eclipse.jface.viewers.TreeViewer in the org.eclipse.ui.dialogs.WizardNewFileCreationPage.java superclass with the newly created project.  I have opened Eclipse UI enhancement #227303 to add support to org.eclipse.ui.dialogs.WizardNewFileCreationPage.java for creating new projects. 

After reviewing the wizards in the New wizard dialog contributed by Eclipse/EMF/XSD/TPTP/WTP/BIRT/DTP/GMF, only DTP's SQL File wizard allows the users to create a new project to contain the resource.  Unfortunately, this wizard uses internal Eclipse UI API to provide this function.  Consistently, the user is expected to create a new project to contain a resource before creating the resource.

The solution for this defect, as a convenience to the user, is to open the create project wizard before the test asset wizard is initialized, only if the workspace does not contain an open project.

Hours worked for design and creating/testing the patch.
Comment 6 Paul Slauenwhite CLA 2008-04-16 11:17:47 EDT
Additional hours worked to resolve the following with all test asset wizards (subclasses of org.eclipse.hyades.ui.internal.wizard.HyadesNewWizard.java):

-The last selected resource (project or folder/file) for the dialog was not caches when the wizard successfully finished its operation.

-Refactored the org.eclipse.hyades.ui.internal.wizard.HyadesNewWizard.adjustSeletion() method since it permitted closed resources to be selected.

In addition, localized an error message in org.eclipse.tptp.test.tools.junit.plugin.internal.ui.wizard.PluginSourcePage.java.
Comment 7 Paul Slauenwhite CLA 2008-04-16 11:18:11 EDT
Created attachment 96271 [details]
Patch.
Comment 8 Paul Slauenwhite CLA 2008-04-16 11:18:30 EDT
Patch checked in to CVS (HEAD).
Comment 9 jkubasta CLA 2009-02-25 11:38:02 EST
closing