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

Bug 316155

Summary: JUnit View: can't open source for test classes in fragments
Product: [Eclipse Project] JDT Reporter: Olaf Titz <olaf.titz>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse, markus.kell.r
Version: 3.5.1   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
3 plug-in projects to reproduce none

Description Olaf Titz CLA 2010-06-08 11:07:19 EDT
Build Identifier: M20090917-0800

I have plugins A, B and C which is a fragment to B.
A is a test harness which creates a JUnit3 TestSuite, containing test classes from both B and C. A is dependent on B.
When a test in B fails, I can open the test class from the JUnit view. When a test in C fails, I get the "Test class not found in selected project" error.

This is related to bug 87492: that added code to look for source in non-exported packages of dependent plugins; what is still missing is looking for source in _fragments_ of dependent plugins (which may not be dependencies themselves).

Reproducible: Always

Steps to Reproduce:
see above
Comment 1 Darin Wright CLA 2010-06-08 11:49:50 EDT
Moving to JDT.
Comment 2 Markus Keller CLA 2010-06-14 12:23:12 EDT
Created attachment 171845 [details]
3 plug-in projects to reproduce

To reproduce, run FragTest and then try to open "frag.Frag.run" from the JUnit view.
Comment 3 Markus Keller CLA 2010-06-14 12:27:44 EDT
Fixed in OpenEditorAction.

The fix is not perfect: It just falls back to searching the type in the workspace if not found in the project, so it could open a wrong one if there are multiple declarations of the same type. A more elaborate strategy could be considered when bug 72847 gets fixed.