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

Bug 341778

Summary: [JUnit] same tests executed twice when running all tests from container that contains suite
Product: [Eclipse Project] JDT Reporter: Nicolas Bros <nicolas.bros>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: markus.kell.r, ruediger.herrmann
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Nicolas Bros CLA 2011-04-04 09:40:33 EDT
I have a project that contains JUnit 4 tests, and a JUnit 4 test suite:

@RunWith(Suite.class)
@SuiteClasses({ MyFirstTest.class, AnotherTest.class })
public class AllTests {}

When I run all the tests on this project, the tests are being run twice. Presumably once for the test class, and a second time because they are in the test suite.

I think the JUnit launcher should filter out duplicate tests before launching them.
Comment 1 Markus Keller CLA 2011-04-18 12:19:44 EDT
Yeah, we could add special code to handle this situation. However, it's unclear which test should not be run, the standalone or the one in a suite.

Other points to consider:
- a test could also be contained in multiple suites
- suites themselves could be nested
- suites can be incomplete (e.g. contain most of the tests in a package, but not all of them)
Comment 2 Eclipse Genie CLA 2020-03-30 10:50:01 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.