Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 286952 - Modification in test editors would invoke incorrect error message upon saving
Summary: Modification in test editors would invoke incorrect error message upon saving
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard:
Keywords:
: 293090 (view as bug list)
Depends on: 262150
Blocks: 290254 290260 294788
  Show dependency tree
 
Reported: 2009-08-18 11:02 EDT by Ben Chen CLA
Modified: 2016-05-05 10:31 EDT (History)
2 users (show)

See Also:


Attachments
Patch. (9.72 KB, patch)
2009-09-24 12:40 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Chen CLA 2009-08-18 11:02:31 EDT
Using tptp.runtime-TPTP-4.6.1-200908150100.zip

If a test asset has its logical name changed in the editor, then any modification other than logical name change done to this test asset in its editor would invoke the error message: "Invalid test element name" when user tries to save. If the modifications include logical name change, then the action is granted upon saving.

If the physical name of the test asset is changed via "F2" or right click -> rename, then modifications would be saved as well.

No error message is shown in the error log
Comment 1 Paul Slauenwhite CLA 2009-08-20 11:46:51 EDT
Required by a consuming product.
Comment 2 Paul Slauenwhite CLA 2009-09-18 10:44:03 EDT
Regression caused by https://bugs.eclipse.org/bugs/show_bug.cgi?id=262150 in org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.isValidToSave().
Comment 3 Paul Slauenwhite CLA 2009-09-18 12:18:19 EDT
The problem is that the resource is not updated in the editor object when changing the test asset name and saving.  As such, the old test asset is being resolved in org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.isValidToSave() (see EMFUtil.getWorkspaceFile(resource)), causing the method think that the user is trying to rename the test asset (to the current name).
Comment 4 Paul Slauenwhite CLA 2009-09-23 09:04:24 EDT
This symptom is not reproducible in TPTP-4.5.2.1-200908191232 since the regression is caused by https://bugs.eclipse.org/bugs/show_bug.cgi?id=262150, which was delivered in TPTP 4.6.  

This defect is no longer required by a consuming product since a bug was in the consuming product code.

The root cause of this defect is captured in Comment 3.  The editor does not update the resource name of the test asset when the user changes the logical name of the test asset in the editor.  This behavior is correct since the logical and resource names are intended to be different, in that the logical name allows customization of the test asset name without affecting the file name within the workspace (see [1] in http://help.eclipse.org/galileo/topic/org.eclipse.hyades.test.doc.user/concepts/cartifacteditor.htm).  However, the save validation code (org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.isValidToSave()) determines that the logical name has changed (compared to the old resource name) and displays the error message since the logical 

Note, defect 290254 has been opened to fix the issues with the other refactoring scenarios (e.g. rename, copy/cut/paste, etc.) synchronizing the logical and resource names.
Comment 5 Paul Slauenwhite CLA 2009-09-23 10:31:46 EDT
(In reply to comment #4)
> The root cause of this defect is captured in Comment 3.  The editor does not
> update the resource name of the test asset when the user changes the logical
> name of the test asset in the editor.  This behavior is correct since the
> logical and resource names are intended to be different, in that the logical
> name allows customization of the test asset name without affecting the file
> name within the workspace (see [1] in
> http://help.eclipse.org/galileo/topic/org.eclipse.hyades.test.doc.user/concepts/cartifacteditor.htm).
>  However, the save validation code
> (org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.isValidToSave())
> determines that the logical name has changed (compared to the old resource
> name) and displays the error message since the logical 

name already exists (or appears to exist) as the resource name.  This validation will be resolved under https://bugs.eclipse.org/bugs/show_bug.cgi?id=290254.  For this defect, we will relax the save validation constraints.
Comment 6 Paul Slauenwhite CLA 2009-09-24 12:40:10 EDT
Created attachment 148028 [details]
Patch.
Comment 7 Paul Slauenwhite CLA 2009-09-24 13:26:53 EDT
The attached patch checked in to CVS (HEAD).

Added a new test case to the following test suite:

/org.eclipse.hyades.test.java.tests/manual/regressionTests/Test.Execution.JUnitRunner.testsuite
Comment 8 Paul Slauenwhite CLA 2009-10-23 06:55:34 EDT
*** Bug 293090 has been marked as a duplicate of this bug. ***
Comment 9 Ben Chen CLA 2010-05-10 14:03:47 EDT
Issue does not occur in TPTP-4.7.0M7-201005041505
Comment 10 Ben Chen CLA 2010-05-10 14:04:07 EDT
Closing after verification