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.
Undock JUnitTest Results window out of the main window. Return back to editor area (in main window), are run few tests by pressing Shift-F6, the content of JUnitTest Results window does not update itself. I always need to go the the window and resize it to force it repaint.
Passing to junit guys.
Reproduced. This is caused by usage of the multiview component as a nested component - the component created by the Multiview API is not used as a TopComponent but it is embedded in another TopComponent. There are many problems with this usage and this is one example. I will modify the test results window - it will not use the multiview component, it will use the split pane instead.
Done (in the trunk). I modified layout of the test results window such that the split pane is used instead of the multiview component. The left panel contains the tree of executed tests and their results, the right panel contains output generated by the tests. Added, removed and modified files: junit/src/org/netbeans/modules/junit/output/: ResultDisplayHandler.java (1.7) ResultWindow.java (1.12) StatisticsPanel.java (1.1 - new file) ResultViewOutput.java (deleted - last rev. 1.2) ResultViewTree.java (deleted - last rev. 1.2) ResultPanelTree.java (1.10) Diffs: http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultDisplayHandler.java?r1=1.6&r2=1.7&diff_format=u http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultWindow.java?r1=1.11&r2=1.12&diff_format=u http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/StatisticsPanel.java?rev=1.1&content-type=text/vnd.viewcvs-markup http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultPanelTree.java?r1=1.9&r2=1.10&diff_format=u
Reproducible on ... Product Version: NetBeans IDE Dev (Build 20071107092450) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
I found that validity status of the test results TopComponent differs, depending on whether it is docked or undocked: The test results TopComponent's children change - when new test results are to be displayed, the previous results are first removed using method Container.removeAll() and then new results are displayed using Container.add(...). Both these methods perform the same routine at the end: if (valid) { invalidate(); } I found that value of variable 'valid' differs: - it is 'true' if the TopComponent is docked - it is 'false' if the TopComponent is undocked If the value is 'false', the TopComponent does not get invalidated and repainted.
Fixed in the trunk. I think that the failure to revalidate the undocked TopComponent is an AWT/Swing failure (I have to verify it yet). A quick, low risk and fully functional solution was to add a call to revalidate() immediately after the code which swaps the TopComponent's children (see the diff). Modified file: junit/src/org/netbeans/modules/junit/output/ResultWindow.java (1.17) Diff: http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/output/ResultWindow.java?r1=1.16&r2=1.17
This has probably the same cause as JDK bug #6359223 ("setContentPane doesn't re-validate", http://bugs.sun.com/view_bug.do?bug_id=6359223) and possibly also to #4949810 (http://bugs.sun.com/view_bug.do?bug_id=4949810).
Verified Product Version: NetBeans IDE Dev (Build 20071112080139) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Please fix this issue also in release60 branch.
Created attachment 52919 [details] patch for branch release60
Reviewed, the fix is simple and isolated and should not affect anything else.
Fixed in branch "release60". Modified file: junit/src/org/netbeans/modules/junit/output/ResultWindow.java (1.15.4.1) Diff: http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/output/ResultWindow.java?r1=1.15&r2=1.15.4.1