This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I got the following assertion while trying to run some junit test. However I can't easily reproduce this problem. It seemed to have something to do with my consecutive junit test invokations. java.lang.AssertionError at org.netbeans.modules.junit.output.ResultDisplayHandler.displayReport(ResultDisplayHandler.java:286) at org.netbeans.modules.junit.output.Manager.displayReport(Manager.java:312) at org.netbeans.modules.junit.output.JUnitOutputReader.suiteFinished(JUnitOutputReader.java:542) at org.netbeans.modules.junit.output.JUnitOutputReader.closePreviousReport(JUnitOutputReader.java:730) at org.netbeans.modules.junit.output.JUnitOutputReader.finishReport(JUnitOutputReader.java:553) at org.netbeans.modules.junit.output.JUnitOutputReader.buildFinished(JUnitOutputReader.java:520) at org.netbeans.modules.junit.output.JUnitAntLogger.buildFinished(JUnitAntLogger.java:173) at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.buildFinished(NbBuildLogger.java:368) at org.apache.tools.ant.Project.fireBuildFinished(Project.java:1848) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:247) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:293) [catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:131)
Created attachment 34408 [details] NetBeans version
Accepted.
It seems to be revision 1.3.4.1.2.1 of ResultDisplayHandler.java.
The assertion error really marks an error in the source code, specificaly a missing assignment statement in method setTreePanel(...): ... if (runningSuite != null) { treePanel.displaySuiteRunning(...) + runningSuite = null; } ... The consequence of the missing statement is that after the setTreePanel(...) method is called, variable 'runningSuite' may be non-null while it *should* be null (according to the meaning of the variable). The correct value (according to the declaration) is later checked by the assert statement at line 286 - and it fails. But although the strict logic says "variable 'runningSuite' should be reset to null after its value was passed to the 'treePanel'", in fact, variable 'runningSuite' becomes insignificant once method setTreePanel(...) has been called. In other words, the failing assert statement checks a correct value (according to the declaration) of a a currently meaningless variable/field. Briefly - the bug can be fixed by any of the following ways: - addition of the missing assertion statement - removal of the failing assertion statement at line 286 - disabling of assertion checks in class ResultDisplayHandler In final version of NetBeans 5.5, all assertion statements will be disabled - so this bug will not manifest itself in the final version. In development versions of NetBeans 5.5 (and NB 6.0), it is possible to workaround the bug by disabling assertion checks for class ResultDisplayHandler. To do so, modify file <netbeans-install-dir>/etc/netbeans.conf - add the following switch *after* switch "-J-ea" in the line beginning with "netbeans_default_options=": -J-da:org.netbeans.modules.junit.output.ResultDisplayHandler I will make the proper fix to NetBeans 6.0 but I will not make it in NetBeans 5.5 (too late for non-critical fixes).
Correction: There should be "addition of the missing *assignment* statement" in the text above.
Fixed in the trunk. Modified file: junit/src/org/netbeans/modules/junit/output/ResultDisplayHandler.java (1.8) Diff: http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultDisplayHandler.java?r1=1.7&r2=1.8&diff_format=u