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.
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
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,...
Created attachment 9588 [details] The visibility test, that demonstrate the buggy behavior.
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?
Created attachment 9600 [details] Modified testcase.
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.
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.
Created attachment 9653 [details] Listener to be added to Toolkit.
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.
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.
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)
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.
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.
Created attachment 11648 [details] The test to demonstrate the bug.
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.
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.
Created attachment 11649 [details] Test able to reproduce problem without jemmy.
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.
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.
Created attachment 11653 [details] Workaround for the JDK listeners bug.
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 :-)
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.
Filed against JDK as issue 4924516. Changing state to invalid.
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.
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!
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
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).
Fixed in JDK1.5.0-b26.