| Summary: | [JUnit] Run As does not recognize JUnit test with generics | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Robin Rosenberg <robin.rosenberg> |
| Component: | UI | Assignee: | 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: | |||
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? Closing as duplicate of bug 474525 as that bug has more details. *** This bug has been marked as a duplicate of bug 474525 *** |
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()); } }