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.

Bug 82228 - Undocked JUnitTest window does not get repainted
Summary: Undocked JUnitTest window does not get repainted
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 08:29 UTC by Jaroslav Tulach
Modified: 2007-11-13 10:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for branch release60 (460 bytes, patch)
2007-11-13 10:43 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2006-08-09 08:29:58 UTC
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.
Comment 1 David Simonek 2006-08-09 10:12:02 UTC
Passing to junit guys.
Comment 2 Marian Petras 2006-08-14 08:53:16 UTC
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.
Comment 3 Marian Petras 2006-08-14 09:29:32 UTC
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
Comment 4 Jiri Vagner 2007-11-07 12:44:54 UTC
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)
Comment 5 Marian Petras 2007-11-09 14:19:35 UTC
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.
Comment 6 Marian Petras 2007-11-09 14:36:21 UTC
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
Comment 7 Marian Petras 2007-11-12 11:32:03 UTC
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).
Comment 8 Jiri Vagner 2007-11-12 11:32:21 UTC
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)
Comment 9 Marian Mirilovic 2007-11-12 16:57:01 UTC
Please fix this issue also in release60 branch.
Comment 10 Marian Petras 2007-11-13 10:43:03 UTC
Created attachment 52919 [details]
patch for branch release60
Comment 11 Maros Sandor 2007-11-13 10:50:58 UTC
Reviewed, the fix is simple and isolated and should not affect anything else.
Comment 12 Marian Petras 2007-11-13 10:53:32 UTC
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