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

Bug 213786

Summary: [JUnit] Add context menu action to import junit test results from package explorer
Product: [Eclipse Project] JDT Reporter: Brock Janiczak <brockj>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P4 CC: daniel_megert, markus.kell.r
Version: 3.4Keywords: helpwanted
Target Milestone: 3.5 M2Flags: markus.kell.r: review+
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to org.eclipse.jdt.junit
none
JUnit view editor launcher markus.kell.r: iplog+

Description Brock Janiczak CLA 2007-12-23 00:51:09 EST
Version: 3.4.0
Build id: I20071213-1700

When using tools such as Maven or Ant to run your unit tests it can be quite inconvenient to use the import results action in the JUnit view, as it requires an absolute system path.  One solution is to add a context menu to files that look like test results.

I will attach a patch that adds a content type for the JUnit test result (required quite a few changes).  The patch requires a bit of cleanup (action placement and NLS)
Comment 1 Brock Janiczak CLA 2007-12-23 00:52:39 EST
Created attachment 85761 [details]
Patch to org.eclipse.jdt.junit
Comment 2 Dani Megert CLA 2007-12-27 06:38:59 EST
I'm not hot on adding this content type as this probably won't be used often and has performance implications for all existing XML types and files (see bug 182337 for example).

I suggest to also allow importing from existing projects.


Markus please comment.
Comment 3 Brock Janiczak CLA 2007-12-27 07:06:46 EST
Perhaps an alternative is to use a file system/workspace selection dialog, like in the patch creation wizard?
Comment 4 Markus Keller CLA 2008-01-17 05:21:12 EST
I'm also not keen on adding an objectContribution for this. Maybe we could add it as an editor such that you can use 'Open With > JUnit View' to open test runs.
Comment 5 Markus Keller CLA 2008-08-11 10:17:35 EDT
We should do this via a contribution to 'org.eclipse.ui.editors', using the 'launcher' attribute to supply an IEditorLauncher for test result files in the workspace.
Comment 6 Brock Janiczak CLA 2008-08-11 20:08:43 EDT
Created attachment 109722 [details]
JUnit view editor launcher

This patch should work for both surefire and ant based junit reports.  It needs to define a new content type so the open with junit view is not shown on all xml files.
Comment 7 Markus Keller CLA 2008-08-15 13:03:22 EDT
Thanks, released the second patch with a few tweaks to HEAD. I also added a provisional icon and will ask the designers for a professional one.