harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r478493 - /harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java
Date Thu, 23 Nov 2006 07:01:04 GMT
Author: mloenko
Date: Wed Nov 22 23:01:03 2006
New Revision: 478493

URL: http://svn.apache.org/viewvc?view=rev&rev=478493
Log:
applied patch for HARMONY-2148
[classlib][awt][test] unit test fails: j.a.KeyboardFocusManagerRTest

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java?view=diff&rev=478493&r1=478492&r2=478493
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/KeyboardFocusManagerRTest.java
Wed Nov 22 23:01:03 2006
@@ -32,12 +32,7 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        robot = null;
-        try {
-            robot = new Robot();
-        } catch (AWTException e) {
-            fail();
-        }
+        robot = new Robot();
         f = new Frame();
         kfm = new DefaultKeyboardFocusManager();
     }
@@ -50,7 +45,6 @@
         }
     }
 
-    @SuppressWarnings("deprecation")
     public final void testRedispatchEvent() {
         Component c1 = new Component(){};
         Component c2 = new Component(){};
@@ -63,7 +57,7 @@
         p.add(c2);
         f.add(p);
         f.setSize(100, 100);
-        f.show();
+        f.setVisible(true);
         waitFocus(c1);
         kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
         assertSame(c1, kfm.getFocusOwner());
@@ -71,7 +65,10 @@
                                    KeyEvent.VK_TAB,
                                    KeyEvent.CHAR_UNDEFINED);
         kfm.redispatchEvent(c1, ke);
-        robot.delay(200);
+        int timeout = 10;
+        while (timeout-- > 0 && c2 != kfm.getFocusOwner()) {
+            robot.delay(200);
+        }
         assertSame(c2, kfm.getFocusOwner());
     }
 



Mime
View raw message