-
Notifications
You must be signed in to change notification settings - Fork 908
Description
Apache NetBeans version
Apache NetBeans 28 latest daily build
What happened
Unexpected error notification pops up after running tests:
java.lang.AssertionError
at org.netbeans.modules.gsf.testrunner.ui.api.TestsuiteNode.displayReport(TestsuiteNode.java:208)
at org.netbeans.modules.gsf.testrunner.ui.RootNodeChildren.displayReport(RootNodeChildren.java:174)
at org.netbeans.modules.gsf.testrunner.ui.RootNode.displayReport(RootNode.java:160)
at org.netbeans.modules.gsf.testrunner.ui.ResultPanelTree.displayReport(ResultPanelTree.java:192)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
[catch] at org.netbeans.modules.gsf.testrunner.ui.ResultDisplayHandler$3.run(ResultDisplayHandler.java:404)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:702)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Narrowed the issue down to the following circumstances:
- Gradle Java project
- JUnit Jupiter tests
- Using
@ParameterizedTest
- At least two separate JUnit test class files share the same method name (and both use
@ParameterizedTest
)
Under these circumstances, the assertion at TestsuiteNode.java:208 expects that the suiteName
equals the report's getSuiteClassName()
but this fails. Debugging a local build, report.getSuiteClassName()
in this case appears to be the method name instead of the class name.
Expected:
Using the same situation with a Maven build, the Test Results window shows two classes with the parameterized tests nested within each:

Actual (dev-02b2c5b1c830bad2a50a64d1818be6147db481c0):
Using a Gradle build, the parameterized test method name appears as its own suite, with only one set of results and it's unclear from which of the two test classes the results are reporting from:

NB27 behavior:
NB27 doesn't bubble up the assertion, but notice that its Test Results window shows a different (broken) behavior -- the parameterized tests are listed twice, but the "normal" @Test
methods and the class names are missing:

Language / Project Type / NetBeans Component
Gradle Java project with JUnit 5 Jupiter tests
How to reproduce
Minimal reproducer Gradle project with test sources:
Did this work correctly in an earlier version?
Apache NetBeans 27
Operating System
WSL2 on Windows 11
JDK
24.0.2; OpenJDK 64-Bit Server VM 24.0.2+12
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
Yes