changeset 14451:f9073d041c9d

8130430: [TEST_BUG] remove unnecessary internal calls from javax/swing/JRadioButton/8075609/bug8075609.java Reviewed-by: alexsch
author yan
date Thu, 09 Jul 2015 12:34:12 +0300
parents 497370175665
children 7b979289680f
files test/javax/swing/JRadioButton/8075609/bug8075609.java
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/JRadioButton/8075609/bug8075609.java	Mon May 17 17:07:49 2021 +0300
+++ b/test/javax/swing/JRadioButton/8075609/bug8075609.java	Thu Jul 09 12:34:12 2015 +0300
@@ -35,11 +35,9 @@
 import javax.swing.event.*;
 import java.awt.event.*;
 import java.awt.*;
-import sun.awt.SunToolkit;
 
 public class bug8075609 {
     private static Robot robot;
-    private static SunToolkit toolkit;
     private static JTextField textField;
 
     public static void main(String args[]) throws Throwable {
@@ -53,7 +51,6 @@
         Thread.sleep(100);
 
         robot.setAutoDelay(100);
-        toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
 
         // Radio button group tab key test
         runTest1();
@@ -96,10 +93,10 @@
     private static void runTest1() throws Exception{
         hitKey(robot, KeyEvent.VK_TAB);
 
-        robot.setAutoDelay(1000 );
+        robot.delay(1000 );
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
-                if (textField.hasFocus()) {
+                if (!textField.hasFocus()) {
                     System.out.println("Radio Button Group Go To Next Component through Tab Key failed");
                     throw new RuntimeException("Focus is not on textField as Expected");
                 }
@@ -110,6 +107,6 @@
     private static void hitKey(Robot robot, int keycode) {
         robot.keyPress(keycode);
         robot.keyRelease(keycode);
-        toolkit.realSync();
+        robot.waitForIdle();
     }
 }