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 66525 - 2.2.4, operators, AbstractButtonHandler.push() doesn't make button visible, throws exception
Summary: 2.2.4, operators, AbstractButtonHandler.push() doesn't make button visible, t...
Status: CLOSED WONTFIX
Alias: None
Product: qa
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@qa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-11 19:32 UTC by arhus
Modified: 2011-02-17 09:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
One of two files that can recreate the problem when running under Java 1.5 on Mac OS X (1.08 KB, text/plain)
2006-01-05 14:40 UTC, david_kane
Details
Two of two files that can recreate the problem when running under Java 1.5 on Mac OS X (817 bytes, text/plain)
2006-01-05 14:41 UTC, david_kane
Details
One of two files that can recreate the problem when running under Java 1.5 on Windows XP (1.30 KB, text/plain)
2006-01-05 15:25 UTC, david_kane
Details
Two of two files that can recreate the problem when running under Java 1.5 on Windows XP (867 bytes, text/plain)
2006-01-05 15:26 UTC, david_kane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arhus 2005-10-11 19:32:40 UTC
Jemmy throws IllegalComponentStateException when a button is not made visible
and an attempt to push the button is performed. We are not able to reproduce it,
since the exception was sent in an anonymous bug report.

See the stack trace below for more info:

java.awt.IllegalComponentStateException: component must be showing on the screen
to determine its location                                                      
                     at getLocationOnScreen_NoTreeLock (java.awt.Component:1678)
                                                                               
                                 at getLocationOnScreen (java.awt.Component:1652)
         at getAbsoluteX (org.netbeans.jemmy.drivers.input.MouseRobotDriver:130)
         at moveMouse (org.netbeans.jemmy.drivers.input.MouseRobotDriver:70)   
                                                                               
                      at clickMouse
(org.netbeans.jemmy.drivers.input.MouseRobotDriver:79)                         
                                                                              
at push (org.netbeans.jemmy.drivers.buttons.ButtonMouseDriver:57)
         at push (org.netbeans.jemmy.operators.AbstractButtonOperator:334)
         at doClick (jeek.handlers.AbstractButtonHandler$AutomationContext:161)
         at invoke0 (sun.reflect.NativeMethodAccessorImpl:-2)
         at invoke (sun.reflect.NativeMethodAccessorImpl:39)
         at invoke (sun.reflect.DelegatingMethodAccessorImpl:25)
         at invoke (java.lang.reflect.Method:585)
         at callMethod (jeek.handlers.TestHandler$AutomationContext:409)
         at automate (jeek.handlers.TestHandler:128)
         at trueRunAction
(jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:240)
         at runAction
(jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:167)
         at run
(jeek.modules.automatizer.dautomatizer.ActionDispatcher$ActionRunner:123)
Comment 1 david_kane 2005-12-28 21:47:43 UTC
Folks,

I have encountered this issue as well.  I have been able to replicate the problem when running Java 1.5 
on Mac OS X.  The issue doesn't seem to surface with Java 1.4 on the Mac, nor does it seem to appear 
on either Java 1.4 or 1.5 on Windows XP.

My stacktrace is below.  It appears to be identical to the original report.

Sincerely,
David Kane

java.awt.IllegalComponentStateException: component must be showing on the screen to determine its 
location
	at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:1678)
	at java.awt.Component.getLocationOnScreen(Component.java:1652)
	at org.netbeans.jemmy.drivers.input.MouseRobotDriver.getAbsoluteX(MouseRobotDriver.java:130)
	at org.netbeans.jemmy.drivers.input.MouseRobotDriver.moveMouse(MouseRobotDriver.java:70)
	at org.netbeans.jemmy.drivers.input.MouseRobotDriver.clickMouse(MouseRobotDriver.java:79)
	at org.netbeans.jemmy.drivers.buttons.ButtonMouseDriver.push(ButtonMouseDriver.java:57)
	at org.netbeans.jemmy.operators.AbstractButtonOperator.push(AbstractButtonOperator.java:334)
	at gov.nih.nci.lmp.gominer.gui.GoMinerGuiSystemTest.runCategoryMenuOption
(GoMinerGuiSystemTest.java:636)
	at gov.nih.nci.lmp.gominer.gui.GoMinerGuiSystemTest.testXMLReport(GoMinerGuiSystemTest.java:
111)
Comment 2 david_kane 2006-01-05 14:40:17 UTC
Created attachment 28206 [details]
One of two files that can recreate the problem when running under Java 1.5 on Mac OS X
Comment 3 david_kane 2006-01-05 14:41:45 UTC
Created attachment 28207 [details]
Two of two files that can recreate the problem when running under Java 1.5 on Mac OS X
Comment 4 david_kane 2006-01-05 15:22:48 UTC
Folks,

I have uploaded a pair of files that I believe reproduces this issue.  I am not sure what version of Jemmy 
we were using when I first noticed the problem, but the error shows up when using the latest build.  
The problem surfaces on Mac OS X, running Java 1.5.  With the earlier version of jemmy we were using, 
this test case passes under Java 1. 4 on Mac OS X.  (I think the latest Jemmy binary is compiled for Java 
1.5)

I had to tweak the code a bit to run on the PC, but I was able to replicate the problem under Windows 
XP under Java 1.5.  

Sincerely,
David Kane
Comment 5 david_kane 2006-01-05 15:25:20 UTC
Created attachment 28208 [details]
One of two files that can recreate the problem when running under Java 1.5 on Windows XP
Comment 6 david_kane 2006-01-05 15:26:09 UTC
Created attachment 28209 [details]
Two of two files that can recreate the problem when running under Java 1.5 on Windows XP
Comment 7 Jiri Skrivanek 2006-01-10 16:10:36 UTC
David, thank you for your test case. It clarifies it a lot. The problem is in
way you are using JMenuItemOperator.push(). This method is inherited from
AbstractButtonOperator and in fact it is not intended to be used by
JMenuItemOperator instance. Instead of this:

      final JPopupMenuOperator menuOperator = new JPopupMenuOperator();
      menuOperator.waitComponentEnabled();
      final JMenuItemOperator menuItemOperator = menuOperator.showMenuItem("B");
      assertTrue(menuItemOperator.isVisible());
      menuItemOperator.push();

you should use this:

      final JPopupMenuOperator menuOperator = new JPopupMenuOperator();
      menuOperator.pushMenu("B");

It does what you want and moreover the code is clearer. I am resolving this
issue as 'wontfix'. Feel free to re-open or add a comment if you think my
resolution is wrong.