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

Bug 529169

Summary: [JUnit 5] JUnit 5 Test Runner not restricted to source folder
Product: [Eclipse Project] JDT Reporter: Robin Textor <robin.textor>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: gautier.desaintmartinlacaze, noopur_gupta, steven.soloff
Version: 4.7.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard: stalebug
Attachments:
Description Flags
Configuration none

Description Robin Textor CLA 2017-12-23 16:53:09 EST
Created attachment 272023 [details]
Configuration

I'm experiencing Bug 101022 with the JUnit 5 Test Runner
As you can see in the attached image, I restricted my test cases to a single source folder, but the tests located in another sourcefolder (namely src/integ_test/java) are being executed as well.
On the other hand, If I create A Junit 5 Launch configuration just for src/integ_test/java everything works as expected.
Comment 1 Sarika Sinha CLA 2018-01-03 01:18:36 EST
Junit is part of JDT UI Project, hence moving it.
Comment 2 Noopur Gupta CLA 2018-01-03 04:20:12 EST
I couldn't reproduce this issue based on the description in comment #0. Please attach a sample Java project to reproduce it.
Comment 3 Robin Textor CLA 2018-01-03 10:10:24 EST
You mentioned a java project, but for this project I'm actually using gradle. Could this cause the issue? The source folders are correctly being displayed as source folders.
Comment 4 Robin Textor CLA 2018-01-03 17:09:54 EST
After some further research + some help from a friend, it seems that this issue actually happens vice versa.
To reproduce, you can clone the triplea project https://github.com/triplea-game/triplea/ import it as a gradle project and create 2 junit 5 run configurations for each test java source folder.

It seems like the tests that share the same package (but are in different source folders) are executed as well. (Friends research, not mine btw.)

So to create a smaller test example you could create a project with 2 test source folders that both have the exact same package and you'll see that tests in both source folders will be run
Comment 5 Eclipse Genie CLA 2020-04-28 19:13:31 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.