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 59883 - Floating window wars between JU output & all others windows
Summary: Floating window wars between JU output & all others windows
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
: 62165 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-12 23:15 UTC by _ tboudreau
Modified: 2007-11-07 12:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2005-06-12 23:15:28 UTC
If you set the unit test output component to be a floating window, and do the same thing with the 
output window, the result is rather messy.  Right now, at least for NB module projects, nothing appears 
on the failures and errors tabs even when there are failures and errors, so what I really need is the 
output window - which appears and then disappears.

Suggest not using the output window at all if you're going to display unit test output in this way - right 
now, the output window pops up and is immediately replaced by the JUnit results window, and I then 
have to hide it and get the output window back to see what went wrong.  Annoying.
Comment 1 _ tboudreau 2005-06-21 02:26:39 UTC
Note this could be easily cured by not having the JUnit window call requestActive() after completing 
JUnit tests.  I frequently start tests running, then go work on something else while they go in the 
background.  It's very annoying when the JUnit window suddenly steals focus while I'm working on 
something else.
Comment 2 vieiro 2005-08-17 19:31:31 UTC
*** Issue 62165 has been marked as a duplicate of this issue. ***
Comment 3 vieiro 2005-08-17 19:34:38 UTC
Hi, I've marked 62615 as duplicate of this one because I think the behaviour is
the same.

Cheers,
Antonio
Comment 4 Marian Petras 2005-12-08 15:46:51 UTC
I will look at it.
Comment 5 Martin Krauskopf 2006-01-09 08:40:41 UTC
This quite annoying.

0) Float all windows (so there is just editor)
1) Open some test
2) F6 (compile test) - Junit window pops up - good
3) After results appear, i.e. test finishes, click editor
4) F11 (compile project) - Junit widnow pops up

This just on of many scenarios.

> I will look at it.

BTW is this still true? :)
Comment 6 Martin Krauskopf 2006-01-11 12:20:23 UTC
Not sure if this has been happening before, not sure if this the same problem
Tim described, but:

0) everything slided
1) S-F6 test, let's it finished (JUnit pops up - ok)
2) Press Ctrl+4 (output window) --> immediatelly replaced by JUnit windows

So popup behaviour of JUnit windows is quite aggressive and very visible all the
time for a developer working with tests -> I believe it's a P2 since it is very
annoying. It's a pity that such a small bug making nice JUnit window not too usable.
Comment 7 Milan Kubec 2006-01-13 12:50:40 UTC
Are you going to ask for waiver or do you want to fix it?
Comment 8 Milan Kubec 2006-01-17 11:26:48 UTC
I'm not able to reproduce those two scenarios from mkrauskopf, however I'm able
to reproduce behavior described in initial report. Martine are you using 5.0 build?
Comment 9 Milan Kubec 2006-01-17 11:41:40 UTC
Lowering priority to P3. The initailly reported behavior is annoying but after
selecting the Output window for the second time it behaves correctly.
Comment 10 Martin Krauskopf 2006-01-17 11:53:57 UTC
Both are easily rerpoduced on linux, jdk 1.6.0-b59c and quite annoying as I
said. I'm not marking this P2 just because of my usecases. There seems to be
more problems and more ways how to reproduce similar problems. And I'm not the
alone who complains about it. Also I believe this all is just about one problem
- fixing  it would probably solves all the scenarios.
Comment 11 Marian Petras 2006-01-17 13:29:56 UTC
OK, let's keep it P2. Although I would like it to work correctly in NB 5.0, it
is too late for fixing it.
Comment 12 vieiro 2006-01-17 14:41:18 UTC
If I were you I'd set 5.2 as a target milestone. After all this seems to be a
hard one. A long lived one. After all, it has taken more than... 7 months (not)
to be solved!! (although it is reported as "quite annoying").
Comment 13 Martin Krauskopf 2006-03-15 09:34:13 UTC
Just changing subject. Since JUnit window annoys all the time, no matter what
windows has just been (tried to be) activated. E.g. Verisoning window.
Comment 14 Martin Krauskopf 2006-03-15 09:35:14 UTC
BTW is there any workaround? I would like to disable the JUnit window at all
until this bug is fixed. Is it possible?
Comment 15 _ tboudreau 2006-03-15 10:26:33 UTC
You and me both.  If I could just have the output window alone I'd be 
perfectly happy.

Something calls requestActive() way to aggressively in the JUnit output 
window - even if you open some other window, it jumps back to the front 
unexpectedly - it's really evil.

Probably at least it could modify its behavior if Boolean.TRUE.equals 
(junitOutputWindow.getClientProperty("isSlidng")) to not call requestActive() 
all the time - but I think it is calling it too much even if it's not sliding.
Comment 16 Marian Petras 2006-03-15 11:03:45 UTC
I will try to fix it as soon as possible.
Comment 17 Martin Krauskopf 2006-05-11 08:28:13 UTC
I know you are surely overloaded by another work. Please just let me know if you
plan to fix this one in the next few weeks. If not I'll try to hack/fix my own
build and eventually put the workaround/fix here (more likely workaround).
Comment 18 _ tboudreau 2006-05-11 08:52:59 UTC
Ought to be easy to find - just override requestActive() to print a stack trace - the problem's 100% 
reproducible.
Comment 19 Marian Petras 2006-05-26 20:51:47 UTC
The problem is a bad mechanism which activates the JUnit results window. This
will be changed: the JUnit output window will not be so eager and it will only
activate when an Ant task doing some testing is executed, it will not try to
guess from an Ant _target_ whether it is going to run tests or not. The
mechanism causing this bug will be totally removed.
Comment 20 Marian Petras 2006-05-26 21:17:25 UTC
Fixed in the trunk.

The buggy mechanism for activating the JUnit results window was removed.

Modified files:
src/org/netbeans/modules/junit/output/JUnitOutputReader.java   (1.19)
src/org/netbeans/modules/junit/output/junit-test-results.settings   (1.2)
src/org/netbeans/modules/junit/output/TaskType.java   (1.1 - initial revision)
src/org/netbeans/modules/junit/output/junit-test-results.wstcref   (1.2)
src/org/netbeans/modules/junit/output/AntSessionInfo.java   (1.3)
src/org/netbeans/modules/junit/output/Manager.java   (1.10)
src/org/netbeans/modules/junit/output/JUnitAntLogger.java   (1.14)
nbproject/project.properties   (1.8)

Diffs:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java?r1=1.18&r2=1.19&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/junit-test-results.settings?r1=1.1&r2=1.2&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/TaskType.java?rev=1.1&content-type=text/vnd.viewcvs-markup
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/junit-test-results.wstcref?r1=1.1&r2=1.2&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/AntSessionInfo.java?r1=1.2&r2=1.3&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/Manager.java?r1=1.9&r2=1.10&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/JUnitAntLogger.java?r1=1.13&r2=1.14&diff_format=u
http://junit.netbeans.org/source/browse/junit/nbproject/project.properties?r1=1.7&r2=1.8&diff_format=u

The change fixes also the following bugs:
  bug #70749 - JUnit Results window does not display for tests
               run from freeform projects
  bug #73397 - "Failed to prepare tests" - display better message
  bug #73933 - JUnit window pops up after running Ant 'test' target
  bug #76587 - JUnit results window often reopens itself
Comment 21 Martin Krauskopf 2006-05-30 10:08:16 UTC
Finally! ;) Thanks, seems to work perfectly.
Comment 22 rost 2006-10-08 16:52:48 UTC
This is _NOT_ fixed (tested with NetBeans-5.5rc1):
- use menu "Window -> Output"
- use menu "Window -> JUnit Test Results"
- open a unit test
- execute the test with SHIFT-F6 (JUnit Test Results appear)
- now try to switch back to the output window (mouse click or menu...)
- JUnit Test Results appear instead of output window
Comment 23 Marian Petras 2006-10-10 11:24:06 UTC
This is fixed in the development build (the base for NetBeans 6.0), not in CVS
branch 'release55' (the base for NetBeans 5.5). Bugs fixed in the development
builds only have "Target milestone" set to "Dev", bugs fixed in CVS branch
'release55' have "Target milestone" set to "5.5".
Comment 24 Jiri Vagner 2007-11-07 12:23:54 UTC
Verified

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)