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

Bug 462854

Summary: [JUnit] Run As does not recognize JUnit test with generics
Product: [Eclipse Project] JDT Reporter: Robin Rosenberg <robin.rosenberg>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta, stephan.herrmann
Version: 4.4.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Robin Rosenberg CLA 2015-03-23 10:55:42 EDT
When right-clicking on a test class like below, there is no JUnit alternatice in the "Run As" menu. 

package x;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;

import org.junit.Test;

public class XTest<T> {

	@Test
	public void testX() {
		assertEquals(0, new ArrayList<T>().size());
	}
}
Comment 1 Stephan Herrmann CLA 2015-03-26 18:01:06 EDT
Naive question: what's the use of making XTest generic? When it's instantiated by the JUnit framework no-one actually gets to pick a concrete type for T. You might as well use j.l.Object to replace all occurrences of T, no?
Comment 2 Noopur Gupta CLA 2015-08-10 06:39:11 EDT
Closing as duplicate of bug 474525 as that bug has more details.

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