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 48530 - [CDE-Sol] Focus isn't transfered back to the Property sheet after closing modal dialog by call close() method
Summary: [CDE-Sol] Focus isn't transfered back to the Property sheet after closing mod...
Status: CLOSED WONTFIX
Alias: None
Product: qa
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: issues@qa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-06 11:45 UTC by Marian Mirilovic
Modified: 2011-02-17 09:32 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (77.32 KB, image/png)
2004-09-06 11:47 UTC, Marian Mirilovic
Details
Results page (10.79 KB, image/png)
2004-09-06 11:47 UTC, Marian Mirilovic
Details
Results page (10.79 KB, text/html)
2004-09-06 11:47 UTC, Marian Mirilovic
Details
Log file (9.93 KB, text/plain)
2004-09-06 11:48 UTC, Marian Mirilovic
Details
Test case (7.09 KB, application/octet-stream)
2004-09-08 10:49 UTC, Jiri Skrivanek
Details
ComponentOperator patch (766 bytes, patch)
2004-09-08 10:49 UTC, Jiri Skrivanek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2004-09-06 11:45:56 UTC
[nb_dev](200409051800), [jdk1.5.0](rc)

I've experienced a lot of 
"org.netbeans.jemmy.TimeoutExpiredException: Wait
component has focus"
during Property Editors tests. This problems
occurs only on Solaris/SPARC , it works fine on
Win XP, LinRH9 .

Test:
- open our property sheet with all properties for
that IDE has property editor / customizer
- try to change values by inplace editing 
- these tests fail only on Sol machines(not only
on Labs machines, it fails on my Sol too).
See attached screeenshot, log file and results page.


tests fail with next exception :
-----------------------
org.netbeans.jemmy.TimeoutExpiredException: Wait
component has focus
	at
org.netbeans.jemmy.Waiter.waitAction(Waiter.java:140)
	at
org.netbeans.jemmy.operators.ComponentOperator.waitHasFocus(ComponentOperator.java:955)
	at
org.netbeans.jemmy.drivers.focus.MouseFocusDriver.giveFocus(MouseFocusDriver.java:72)
	at
org.netbeans.jemmy.drivers.text.TextKeyboardDriver.clearText(TextKeyboardDriver.java:60)
	at
org.netbeans.jemmy.drivers.text.SwingTextKeyboardDriver.clearText(SwingTextKeyboardDriver.java:55)
	at
org.netbeans.jemmy.drivers.tables.JTableMouseDriver.editCell(JTableMouseDriver.java:71)
	at
org.netbeans.jemmy.operators.JTableOperator.changeCellObject(JTableOperator.java:952)
	at
gui.propertyeditors.PropertyEditorsTest.setByInPlace(PropertyEditorsTest.java:130)
	at
gui.propertyeditors.PropertyType_byte.testByInPlace(PropertyType_byte.java:54)
	at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
junit.framework.TestCase.runTest(TestCase.java:154)
	at
junit.framework.TestCase.runBare(TestCase.java:127)
	at
org.netbeans.jellytools.JellyTestCase.runBare(JellyTestCase.java:112)
	at
junit.framework.TestResult$1.protect(TestResult.java:106)
	at
junit.framework.TestResult.runProtected(TestResult.java:124)
	at
junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at
org.netbeans.junit.NbTestCase.run(NbTestCase.java:119)
	at
junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:176)
	at
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:127)
	at
org.netbeans.xtest.plugin.ide.MainWithExec.run(MainWithExec.java:196)
	at
org.netbeans.xtest.plugin.ide.Main$2.run(Main.java:313)
	at java.lang.Thread.run(Thread.java:595)
-------------------------
Comment 1 Marian Mirilovic 2004-09-06 11:47:04 UTC
Created attachment 17387 [details]
screenshot
Comment 2 Marian Mirilovic 2004-09-06 11:47:33 UTC
Created attachment 17388 [details]
Results page
Comment 3 Marian Mirilovic 2004-09-06 11:47:41 UTC
Created attachment 17389 [details]
Results page
Comment 4 Marian Mirilovic 2004-09-06 11:48:03 UTC
Created attachment 17390 [details]
Log file
Comment 5 Jiri Skrivanek 2004-09-06 15:43:07 UTC
There is something wrong but the test itself can be modified to pass.
So, lowering priority. 
It fails because modal informational dialog is closed by method
JDialogOperator.close(). Then the focus is transfered to an unknown
component and not to property sheet dialog. It helps if you switch to
another window and then back to properties sheet window. If the
information dialog is closed by OK button it works as expected.
So, I suggest to fix tests to close the information dialog by OK
button. For example PropertyType_DoubleO test does it well but
PropertyType_Class should be fixed to use waitDialog property.
I'll try to investigate why it fails when close() method is used.
Comment 6 Marian Mirilovic 2004-09-07 09:04:44 UTC
Jirka,
thank you very much for evaluation, I've fixed JDialogOperator.close()
problem in all my tests, see issue 48564, so this issue is only about
not transfered focus back to property sheet after closing dialog by
method close().
Comment 7 Jiri Skrivanek 2004-09-07 14:15:51 UTC
I found out it is a big coincidence. The test doesn't wait for modal
dialog (informational) which is about to appear but it wants to do
operations with its parent (property sheet window). So, jemmy focuses
the property sheet window and after then the modal dialog is open. The
modal dialog doesn't get focus which is probably an issue of JDK on
solaris. When the focusless modal dialog is closed, the focus is not
transfered to its parent.
I think we can't do anything with this issue. When the test is written
properly, it is gone. Maybe we can post makeComponentVisible() method
to the AWT event queue. But I am not sure about it. What does Shura think?
Comment 8 Alexandre Iline 2004-09-07 20:50:15 UTC
Marian, do you use CDE on solaris?  
 
From what you're describing, it looks like you have "point in window to 
make active" option selected. Jemmy does not support this weird thing. 
 
Just checking ... 
 
As for the makeComponentVisible, I am not sure I follow ... 
 
Jirka, where do you propose to run it? After dialog closing? 
What "post makeComponentVisible() method to the AWT event queue" 
means? 
 
Comment 9 Marian Mirilovic 2004-09-07 20:56:38 UTC
> Marian, do you use CDE on solaris?  

Yes, I am.
 
> From what you're describing, it looks like you have "point in window to 
> make active" option selected. Jemmy does not support this weird thing. 

I am sorry, but I didn't run tests with "point in window to make
active" option selected.
Comment 10 Jiri Skrivanek 2004-09-08 10:48:38 UTC
Ok, I will attach a test case which shows the problem. Just run it
like the following:

java -classpath jemmy.jar:test.jar test.TestMakeComponentVisible

The test case:

- two dialogs are open (My Dialog, Parent Dialog) 
- in the My Dialog I open a modal dialog which is owned by the Parent
Dialog (this is the case when informational dialog in IDE is owned by
the main window instead of a properties sheet dialog)
- I make My Dialog visible => My Dialog is focused and the modal
dialog looses focus
- I close the modal dialog => My Dialog seems to be focused BUT I
cannot type anything into JTextField. I have to click on the Parent
Dialog and then back on the My Dialog to be able to type in the text
field.

So, there is a problem with synchronization. Attached patch solves the
problem.
Comment 11 Jiri Skrivanek 2004-09-08 10:49:26 UTC
Created attachment 17472 [details]
Test case
Comment 12 Jiri Skrivanek 2004-09-08 10:49:54 UTC
Created attachment 17473 [details]
ComponentOperator patch
Comment 13 Alexandre Iline 2004-10-04 20:09:22 UTC
the fix you propose fails jemmy_029 test. 
So, it is not ok - it breaks compatibility. 
 
And, BTW, for me, on Linux, it works fine - focus is on the button,  
I have to hit Tab to get to the text field and type. 
 
Work as expected, I would say. 
 
As wrokaround is known already, I am closing it as won't fix. 
Comment 14 Jiri Skrivanek 2004-10-06 13:12:58 UTC
It happens only on Solaris CDE. Anyway I don't push to fix it because
it is not a common case.
Comment 15 Marian Mirilovic 2005-07-15 13:18:43 UTC
closed