Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 228991 - Impossible to copy/paste files from windows explorer to test navigator
Summary: Impossible to copy/paste files from windows explorer to test navigator
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Bozier jerome CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-26 09:39 EDT by jkubasta CLA
Modified: 2016-05-05 10:31 EDT (History)
1 user (show)

See Also:
paulslau: review+


Attachments
Screen capture. (14.24 KB, image/jpeg)
2008-04-28 11:06 EDT, Paul Slauenwhite CLA
no flags Details
fix for external copy paste (13.24 KB, text/plain)
2008-04-30 02:47 EDT, Bozier jerome CLA
no flags Details
manual test for external copy/paste bug (1.12 KB, application/x-zip-compressed)
2008-04-30 11:59 EDT, Bozier jerome CLA
no flags Details
cleaned patch (17.02 KB, patch)
2008-04-30 13:00 EDT, Bozier jerome CLA
no flags Details | Diff
cleaned patch (17.20 KB, patch)
2008-04-30 13:15 EDT, Bozier jerome CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jkubasta CLA 2008-04-26 09:39:54 EDT
Currently, copying a file from the windows explorer and pasting it into a performance test project in the test navigator fails, the following NPE being raised:
java.lang.NullPointerException
	at org.eclipse.hyades.test.ui.internal.navigator.action.FileAndFolderPaster.sortClipboardElements(FileAndFolderPaster.java:62)
	at org.eclipse.hyades.test.ui.internal.navigator.action.FileAndFolderPaster.performPaste(FileAndFolderPaster.java:99)
	at org.eclipse.hyades.test.ui.internal.navigator.action.PasteAction.run(PasteAction.java:65)
...
...

Work-around: either use the Import > File system feature, or paste the copied file into another view like the navigator or the project explorer.
Comment 1 Bozier jerome CLA 2008-04-28 05:12:57 EDT
tested it with latest tptp version, and nothing can raise such exception at this line
there was such kind of bug with first delivery of 166025 patch but this was fixed some time ago (see bugzilla 166025, comment 63, under CVS since 4/11/08)
problem was an empty clipboard that raised this exception.
Comment 2 Paul Slauenwhite CLA 2008-04-28 11:05:06 EDT
Using the TPTP M5 driver, files could be copied from Window Explorer/Desktop and pasted in the Test Navigator.

Using the TPTP M7 driver, there is no NullPointerException when pasting files in the Test Navigator that were copied from Window Explorer/Desktop.  However, the files are not pasted successfully in the Test Navigator and the enclosed dialog appears.

As such, increasing the severity since this is a regression of function.
Comment 3 Paul Slauenwhite CLA 2008-04-28 11:06:49 EDT
Created attachment 97787 [details]
Screen capture.

We need to fix this problem as well as the size of the informational dialog.
Comment 4 Bozier jerome CLA 2008-04-30 02:47:23 EDT
Created attachment 98127 [details]
fix for external copy paste

this patch fix the external copy/paste (copy from windows explorer for example and paste inside test navigator)
Comment 5 Bozier jerome CLA 2008-04-30 02:47:54 EDT
worked hours updated
Comment 6 Bozier jerome CLA 2008-04-30 11:59:39 EDT
Created attachment 98209 [details]
manual test for external copy/paste bug
Comment 7 Paul Slauenwhite CLA 2008-04-30 12:02:54 EDT
Patch reviewed and approved with comments:

1) In org.eclipse.hyades.test.ui.internal.navigator.refactoring.PasteFileChange.PasteFileChange(IFile, IContainer), there is no need for:

+		this.externalFileName = null;

2) In org.eclipse.hyades.test.ui.internal.navigator.refactoring.PasteFileChange.perform(IProgressMonitor), we should handle the FileNotFoundException/IOException by displaying an error message and log the error to the .log file.

3) Please add a class comment to ReferenceDisplayUtils.
Comment 8 Paul Slauenwhite CLA 2008-04-30 12:08:15 EDT
(In reply to comment #6)
> Created an attachment (id=98209) [details]
> manual test for external copy/paste bug
> 

Please change the name of this test suite to Test.UI.TestNavigator_bugzilla_228991.testsuite (requires a file and logical rename) and add a test invocation to the behavior to org.eclipse.hyades.test.ui.navigator.tests/manual/AllTests.testsuite.
Comment 9 Bozier jerome CLA 2008-04-30 13:00:04 EDT
Created attachment 98223 [details]
cleaned patch

same patch but cleaned following Paul review
Comment 10 Paul Slauenwhite CLA 2008-04-30 13:12:12 EDT
(In reply to comment #9)
> Created an attachment (id=98223) [details]
> cleaned patch
> 
> same patch but cleaned following Paul review
> 

This patch cannot be integrated since it contains the wrong strings in the error dialog:

new ErrorDialog(Display.getDefault().getActiveShell(), 
+							UiPluginResourceBundle.WIZ_DATAPOOL_CSV_ERRDLG_TITLE,
+							UiPluginResourceBundle._ERROR_WIZ_DATAPOOL_CSV_ERRDLG_IMPFILE,
+							new Status(IStatus.ERROR,
+									UiPlugin.PLUGIN_ID,
+									IStatus.OK,
+									e.toString(),
+									e),IStatus.ERROR).open();

These are the datapool error dialog strings.  
Comment 11 Bozier jerome CLA 2008-04-30 13:15:26 EDT
Created attachment 98224 [details]
cleaned patch

cleaned some misused externalized string
Comment 12 Paul Slauenwhite CLA 2008-04-30 13:19:19 EDT
(In reply to comment #11)
> Created an attachment (id=98224) [details]
> cleaned patch
> 
> cleaned some misused externalized string
> 

Approved.  Please integrate.
Comment 13 Bozier jerome CLA 2008-04-30 13:24:12 EDT
pushed under CVS
Comment 14 jkubasta CLA 2009-02-24 16:16:44 EST
closing