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

Bug 414656

Summary: "TestCase.TESTS_NAMES = null" etc. as suggested in buildTestsList(..) won't work with 1.5
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Markus Keller CLA 2013-08-08 07:08:48 EDT
Javadoc of org.eclipse.jdt.core.tests.junit.extension.TestCase#buildTestsList(Class) suggests a brittle pattern to reset TestCase.TESTS_NAMES and similar fields while executing "global" test suites.

I don't think the suggested pattern would work at all, since the MyTest.class literal only forces MyTest to be loaded *after* the fields have been reset. In practice, JDT Core test suites first create a list of Class objects, then they set the TESTS_* fields to null, and only then they create the suites.

But also that strategy won't work any more as soon as the test projects are compiled to 1.5-level class files, see
http://www.oracle.com/technetwork/java/javase/compatibility-137462.html#literal
Comment 1 Eclipse Genie CLA 2020-03-10 12:38: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.