Bug 548611 - Test attribute ignored for classpath container entries
Summary: Test attribute ignored for classpath container entries
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.13   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-25 04:42 EDT by Donat Csikos CLA
Modified: 2023-06-09 14:53 EDT (History)
0 users

See Also:


Attachments
Local results (1.46 MB, image/png)
2019-06-25 04:45 EDT, Donat Csikos CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Donat Csikos CLA 2019-06-25 04:42:57 EDT
Expected behavior:

When a JDT application is launched with the 'Exclude test code' option enabled then all test dependencies (jars) from the classpath is filtered. This should also be true for the dependencies contributed via a classpath container.


Actual behavior:

The default runtime classpath resolution ignores the `<attribute name="test" value="true"/>` attribute that is defined on a classpath container and adds all entries to the classpath. 


Steps to reproduce:

I've created a sample project exhibiting the problem: https://github.com/donat/eclipse-bug-test-sources

To make the project compile, you'll have to install a custom plugin I wrote that contributes an editable classpath container: https://github.com/donat/mutcont/tree/master/deploy/plugins. Copy the jar to the `dropins` folder of Eclipse.


Then, fix the location of JUnit and Guava in the `entries.xml` file. Once saved, the classpath container should be populated.

Finally, launch the `Main` class via JDT and inspect the output.
Comment 1 Donat Csikos CLA 2019-06-25 04:45:36 EDT
Created attachment 279064 [details]
Local results
Comment 2 Eclipse Genie CLA 2021-06-15 07:21:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2023-06-09 14:53:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.