Bug 362072 - [JUnit] Offer 'Copy' or 'Copy Qualified Name' on selected test
Summary: [JUnit] Offer 'Copy' or 'Copy Qualified Name' on selected test
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: fix candidate
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2011-10-26 10:02 EDT by Dani Megert CLA
Modified: 2019-05-19 10:09 EDT (History)
7 users (show)

See Also:


Attachments
Proposed patch (6.99 KB, patch)
2014-05-20 13:10 EDT, Eric Le Ponner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-10-26 10:02:18 EDT
Offer 'Copy' or 'Copy Qualified Name' on selected test.

Often one only needs to put the failed test into a bug report or an e-mail.
Comment 1 Markus Keller CLA 2011-10-26 10:32:47 EDT
While messing with the copy commands, we should clean this up:

- Edit > Copy (Ctrl+C) should also be in the context menu. Currently copies stacktrace of test. Should copy the test name.

- 'Copy Trace' should also be in context menu of test (not only on Failure Trace).
Comment 2 Eric Le Ponner CLA 2014-05-19 08:55:34 EDT
I started to work on this issue a while ago.
I will resume my work and propose a fix soon.
Comment 3 Eric Le Ponner CLA 2014-05-20 13:10:44 EDT
Created attachment 243306 [details]
Proposed patch

I attached a proposed patch.
As a first step, I focused on the Copy Qualified Name command.
I will come back for the additional reqs (like Copy command)
after getting a better understanding.
Comment 4 Martin Mathew CLA 2014-06-16 03:33:31 EDT
Please add an explicit CoO sign-off comment here.
http://wiki.eclipse.org/Development_Resources/Contributing_via_Git#via_Bugzilla

Here are my review comments:
1. After applying the patch, i am having error in org.eclipse.jdt.junit\META-INF\MANIFEST.MF
Here a package named "org.eclipse.jdt.internal.junit" that doesn't exist is being exported which is causing the error.
2. ActionMessages#CopyQualifiedNameAction_ToolTipText is currently "Copy to fully qualified name to the system Clipboard", it has to be changed to "Copy fully qualified name to the system Clipboard". 
3. Update the copyright year of all modified files.
4. Enter your credentials by filling out the following template and adding it to the header comment of all modified files: 
Your Name <email@example.com> - Bug Title - https://bugs.eclipse.org/BUG_NUMBER

Acknowledging the fact that the patch is a partial fix, i think you are in the right track. Points to be addressed:
1. Add 'Copy' in the context menu and it should just copy the test name. As mentioned in comment 1, it is currently copying the stack trace of a failed test.
2. Add 'Copy Trace' in the context menu
3. Should we add image descriptor for the JUnit context menu items?
Comment 5 Markus Keller CLA 2014-06-30 12:07:26 EDT
(In reply to Manju Mathew from comment #4)
> 3. Should we add image descriptor for the JUnit context menu items?

Yes, "Copy" and "Copy Qualified Name" should have the same images as the same actions in the context menu in the Package Explorer.

The existing "Copy Failure List" and the new "Copy Failure Trace" actions should not get an icon.
Comment 6 Eric Le Ponner CLA 2014-07-01 05:15:05 EDT
Thanks for reviewing Manju.

If I undo my changes to MANIFEST.MF, error below is reported:
    "This plug-in does not export all of its package"

and "Quick Fix" proposes to add 
    org.eclipse.jdt.internal.junit;x-internal:=true,
to MANIFEST.MF.

Not sure I understand what's happening here.
But I will undo changes on MANIFEST.MF anyway.
Comment 7 Martin Mathew CLA 2014-07-01 18:57:45 EDT
(In reply to Eric Le Ponner from comment #6)
> Thanks for reviewing Manju.
> 
> If I undo my changes to MANIFEST.MF, error below is reported:
>     "This plug-in does not export all of its package"
> 
> and "Quick Fix" proposes to add 
>     org.eclipse.jdt.internal.junit;x-internal:=true,
> to MANIFEST.MF.
> 
> Not sure I understand what's happening here.
> But I will undo changes on MANIFEST.MF anyway.

That is strange. There is no package in the plug-in "org.eclipse.jdt.junit" named "org.eclipse.jdt.internal.junit". More over all the existing packages (8 packages)are already exported by this plug-in.