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

Bug 367118

Summary: Tests running via tycho, can't access simpleconfigurator bundles.info this breaks some standard Eclipse functionality
Product: z_Archived Reporter: Kris De Volder <kdevolder>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: igor, kdevolder, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Zipped up copy of a JUnit plugin test that passes when running in Eclipse, failing when running in tycho none

Description Kris De Volder CLA 2011-12-19 13:43:45 EST
Build Identifier: 

Some eclipse functionality depends on the simpleconfigurator to discover information about the host platform. Any such functionality breaks when running JUnit plugin tests with tycho.

For example, I have some JUnit plugin tests that 
  - create a test projects in the runtime workspace
  - add a JUnit libraries classpath container to the test project
  
These test project don't work/compile correctly in the runtime workspace when running inside tycho because the JUnit libraries classpath container doesn't correctly resolve. Thus the projects will be missing JUnit libraries and fail to compile.

With some digging I discovered that the reason why Junit classpath container is not resolving correctly is because the org.eclipse.junit.core plugin relies on 
bundles.info file to discover the installed junit bundles and find the junit jar files in them. 

It does this by calling on functionality from org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator

Relevant code lives in org.eclipse.jdt.internal.junit.buildpath.P2Utils
in the ..eclipse.jdt.junit.core bundle. (E.g. see the 'findBundle' method).

Reproducible: Always

Steps to Reproduce:
1. Import attached plugin project as an 'existing project' into Eclipse RCP
2. Run as Junit plugin test => test passes
3. Create a tycho build that runs the same test suite.
4. The test will fail.
Comment 1 Kris De Volder CLA 2011-12-19 13:46:36 EST
Created attachment 208576 [details]
Zipped up copy of a JUnit plugin test that passes when running in Eclipse, failing when running in tycho
Comment 2 Igor Fedorenko CLA 2011-12-19 14:24:26 EST
We welcome quality patches. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=343152#c3 for more specific requirements.

*** This bug has been marked as a duplicate of bug 343152 ***