Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
10.0
Description
In https://issues.apache.org/jira/browse/NETBEANS-6 some code was added that decides whether a code is a JUnit 5 test or not, by whether its annotation has @Testable
as a "parent" (for lack of a better term). This is too conservative, @Testable is a meta-annotation and can appear anywhere in the parent hierarchy for test method annotations. For example, @ParameterizedTest has @TestTemplate as a parent, which has @Testable as a parent.
The code should be updated to look through the entire annotation hierarchy to figure out if @Testable appears as a parent.
Also when a @ParameterizedTest is run, and the test results window is used to go to the test method, the IDE throws an exception. This happens because the test name of a parameterized test is e.g. "myMethod
{myParamType}[0]", rather than just "myMethod". The lookup code assumes that the test name will appear verbatim in the source.
I think it makes sense to differentiate between the display name of a test method, and the actual method name. Adjusting org.netbeans.modules.gsf.testrunner.api.Testcase to allow this would let us fix this issue, while also making it easier to implement support for e.g. https://junit.org/junit5/docs/5.0.3/api/org/junit/jupiter/api/DisplayName.html at a later date.
Attachments
Issue Links
- blocks
-
NETBEANS-1744 Support Run/Debug Focused Test Method for @Nested JUnit 5 test classes in Maven projects
- In Progress
- links to