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 32466 - jemmy eats some EVENTs (espec. HierarchyEvent)
Summary: jemmy eats some EVENTs (espec. HierarchyEvent)
Status: CLOSED INVALID
Alias: None
Product: qa
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@qa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-28 15:27 UTC by dmladek
Modified: 2011-02-17 09:34 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The visibility test, that demonstrate the buggy behavior. (4.56 KB, application/octet-stream)
2003-03-28 15:37 UTC, Martin Entlicher
Details
Modified testcase. (2.97 KB, text/plain)
2003-03-31 10:06 UTC, Alexandre Iline
Details
Listener to be added to Toolkit. (683 bytes, text/plain)
2003-04-02 11:16 UTC, Jiri Skrivanek
Details
The test to demonstrate the bug. (8.25 KB, application/octet-stream)
2003-09-17 13:03 UTC, Martin Entlicher
Details
Test able to reproduce problem without jemmy. (8.63 KB, application/octet-stream)
2003-09-17 13:57 UTC, Jiri Skrivanek
Details
Workaround for the JDK listeners bug. (10.08 KB, application/octet-stream)
2003-09-17 18:00 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2003-03-28 15:27:43 UTC
Product Version       = NetBeans IDE 3.5 Dev
(Build 200303272350)
  IDE Versioning        = IDE/1 spec=3.42.1
impl=200303272350
  Operating System      = Linux version 2.4.18
running on i386
  Java; VM; Vendor      = 1.4.1_02; Java
HotSpot(TM) Client VM 1.4.1_02-b06; Sun
Microsystems Inc.
  Java Home             =
/usr/java/j2sdk1.4/sun/jdk1.4.1_01/jre
  System Locale; Encod. = cs_CZ; ISO-8859-2
  Home Dir; Current Dir = /home.local/danielm;
/tmp/netbeans/bin
  IDE Install; User Dir =
/home.local/danielm/tmp/netbeans; /tmp/3.5dev
======================================================================

Automatical test for VCS modules (at least for
JavaCVS) beggin failed  2 days ago on all
platforms and on all JDKs.

The reason was  because it wasn't able to checkout
anything.
There was an issue #32161 for that and after 2
days of investigation 
we found that jemmy is the culprit :-(

Pls, for details see mentioned issue for vcscore.
------------

Martin, can you please attach your test class here?
thanks
Comment 1 Martin Entlicher 2003-03-28 15:36:23 UTC
The problem is, that when I register a HierarchyListener to a
component, then the listener will not get
HierarchyEvent.SHOWING_CHANGED when running with
org.netbeans.jemmy.QueueTool$JemmyQueue registered as AWT event queue.

I'm attaching a test class, that demonstrate this:
run: java -cp ~/visibility.jar org.tests.visibility.VisibilityTest
and watch the messages that are printed.
No run the same class with QueueTool$JemmyQueue installed. You will
NOT get:
java.awt.event.HierarchyEvent[HIERARCHY_CHANGED (SHOWING_CHANGED,...
Comment 2 Martin Entlicher 2003-03-28 15:37:40 UTC
Created attachment 9588 [details]
The visibility test, that demonstrate the buggy behavior.
Comment 3 Alexandre Iline 2003-03-31 10:05:09 UTC
It's working for me. 

I've modified the test a little ant executed it 100 times from shell
script - no problem. I've also executed it about 15 times under
Netbeans - works too. Could you, please, check if I made correct changes?

What am I doing wrong?
Comment 4 Alexandre Iline 2003-03-31 10:06:28 UTC
Created attachment 9600 [details]
Modified testcase.
Comment 5 Jiri Skrivanek 2003-04-01 11:55:46 UTC
Neither I don't see difference between output with and without jemmy
event queue. I am ready to see your test case on your computer but for
now I changing to WORKSFORME.
Comment 6 Jiri Skrivanek 2003-04-02 11:13:46 UTC
I am able to reproduce wrong behaviour but after investigation we've
done with Adam, we found that this is not problem of jemmy but maybe
vcscore module or IDE's windows system. Misbehaviour is caused by
adding listener for hierarchy events to Toolkit.

To reproduce problem:

- mount a generic VCS filesystem
- run MyListener class (see attached file) by internal executor in IDE
- on a file in CVS filesystem invoke "CVS|Check Out" from popup menu
- click OK in checkout dialog
- dialog Output of VCS Commands is opened BUT it never shows output.  


It was tested in build Nevada 030331, JDK1.4.1_01, Solaris. On
jdk1.3.1_05 it works fine.
I recommend to open a new bug against vcscore or core (window system)
module. It might be also connected to issue #30598.

Comment 7 Jiri Skrivanek 2003-04-02 11:16:34 UTC
Created attachment 9653 [details]
Listener to be added to Toolkit.
Comment 8 Martin Entlicher 2003-04-03 11:39:59 UTC
If adding an empty listener to an object change the behavior of that
object, it's IMHO clearly a bug of implementation of that object.
In this case the bug is in JDK IMHO.
Comment 9 Jiri Skrivanek 2003-04-03 11:56:20 UTC
Maybe in JDK. maybe in IDE core. Similar issue #30598 was solved by
changes in IDE. Ask responsible developers to exclude possible bug in IDE.
Comment 10 dmladek 2003-08-01 12:20:47 UTC
I had a discussion with Martin about this issue.

I don't feel like to comfirm this as WORKSFORME.
Still we didn't investigate if it is our (IDE) bug or JDK.

The last test was performed on jdk1.4.1xx but now is jdk1.4.2.

So, I need test it with jdk1.4.2 at least. So I hope I'll find time
for that after my vacation (8/12)
Comment 11 Martin Entlicher 2003-09-17 09:22:50 UTC
I'm going to look at the problem once more. There's still problem,
that VCS dialog works in standard NetBeans distribution, but does not
under the test. This looks like the test framework has a defect.

I don't want to remove the HierarchyListener from my code, I'm glad
that it works as it is.
Comment 12 Martin Entlicher 2003-09-17 13:02:28 UTC
Reopening. To reproduce the problem add:
new org.netbeans.jemmy.EventTool().waitNoEvent(2000);
after the installation of the queue.
I'm going to attach an updated jar.
Comment 13 Martin Entlicher 2003-09-17 13:03:45 UTC
Created attachment 11648 [details]
The test to demonstrate the bug.
Comment 14 Martin Entlicher 2003-09-17 13:04:52 UTC
The updated test attached.

Run:
java -classpath ~/nb_all/jemmy/jemmy.jar:visibility.jar
org.tests.visibility.VisibilityTest

and:
java -classpath ~/nb_all/jemmy/jemmy.jar:visibility.jar
org.tests.visibility.VisibilityTest installQueue

And compare the results.
Comment 15 Jiri Skrivanek 2003-09-17 13:56:17 UTC
Jemmy does nothing tricky. The problem appears when listener is added
to Toolkit. But it is not a problem of jemmy but maybe JDK. Try
updated example without jemmy:

Run:
java -classpath vis.jar org.tests.visibility.VisibilityTest

and:
java -classpath vis.jar org.tests.visibility.VisibilityTest addListener

So, it is not a mistake of jemmy. I tend to close this issue against
jemmy as worksforme or invalid.
Comment 16 Jiri Skrivanek 2003-09-17 13:57:19 UTC
Created attachment 11649 [details]
Test able to reproduce problem without jemmy.
Comment 17 dmladek 2003-09-17 14:12:40 UTC
OK then, but how I should make my validation test suite for JavaCVS
make  run?
Plese, check it out and have a look at the line: 529
            checkout.runCommand();

Here my automatic test fails because something blocks communication
between cvs pserver and build-in client, so thus it never checkout
anything and without checkouted sources, there's no way how to
automaticaly test JavaCVS, then.

I don't wanna argue who's bug is this. I need this to be solved to run
my tests. So thus I like to also increase the priority to P1.
Sorry about that.
Comment 18 Martin Entlicher 2003-09-17 17:33:44 UTC
Jiri, you're right. The bug seems to be in JDK.

The attached MyListeners gets the SHOWING_CHANGED event, but nobody
else.

A bug on JDK should be submitted if there's not one already.

I didn't found a workaround for that. The only workaround would be if
the MyListener distributes the SHOWING_CHANGED event. But I'm not sure
whether it can find out where it should be sent.

This should be probably resolved as INVALID, because it does not work,
but it's not a bug in NetBeans or Jemmy. But first it should be
analyzed whether a workaround is possible.

Comment 19 Martin Entlicher 2003-09-17 18:00:12 UTC
Created attachment 11653 [details]
Workaround for the JDK listeners bug.
Comment 20 Martin Entlicher 2003-09-17 18:03:00 UTC
I've created a simple workaround. It just redistributes the
SHOWING_CHANGED event to all components that could be interested.
Well, it can be optimized to only inspect compomemnts from the source
of the original event.

It looks a little dangerous, but it works :-)
Comment 21 Jiri Skrivanek 2003-09-18 09:45:31 UTC
There is also a possible workaround in tests. You need to remove
listeners added by jemmy. For example, in validation test:

        TabbedOutputOfVCSCommandsFrame out;
        try {
            EventTool.removeListeners();
            checkout.runCommand();
            //log("The outpuWindow should open now...\n");
            out=new TabbedOutputOfVCSCommandsFrame();
        } finally{
            EventTool.addListeners();
        }

If this is not acceptable, we will have to patch jemmy by the
workaround suggested by Martin.
Comment 22 Jiri Skrivanek 2003-09-18 11:54:14 UTC
Filed against JDK as issue 4924516. Changing state to invalid.
Comment 23 Jiri Kovalsky 2003-09-19 09:40:26 UTC
I just want to highlight that this bug affects also vcsgeneric module
tests. I am going to check the workaround Jiri suggested. I am glad
that JDK team accepted the bug today and they are going to fix it in
JDK 1.5.
Comment 24 dmladek 2003-09-19 13:16:33 UTC
I'd like to thanks to Jirka S. and Martin for their cooperation and
even thought it wasn't problem in neither of one of their codes they
find solution for automatic test suits.
Thank you all! Great!
Comment 25 dmladek 2003-09-19 13:26:56 UTC
Here's the real link to the JDK's bug in bugparade available on the
NET to all:
http://developer.java.sun.com/developer/bugParade/bugs/4924516.html
Comment 26 Jiri Skrivanek 2003-09-26 13:33:15 UTC
My workaround doesn't work when test is executed more than once in
IDE. That's why I put Martin's workaround into JellyTestCase class.
So, all tests extending JellyTestCase will work fine (since jellytools
version 2.1.6).
Comment 27 Jiri Skrivanek 2003-11-27 09:29:56 UTC
Fixed in JDK1.5.0-b26.