changeset 7082:2c13160443c2

[TEST] RT-36285: RT30650Test fails intermittently on nightly build machine Summary: Increase the delay before performing actual test Reviewed-by: kcr
author Anthony Petrov <anthony.petrov@oracle.com>
date Tue, 20 May 2014 21:08:09 +0400
parents c4fedef42f45
children 7b60160523d6
files tests/system/src/test/java/javafx/embed/swing/RT30650GUI.java tests/system/src/test/java/javafx/embed/swing/RT30650Test.java
diffstat 2 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/tests/system/src/test/java/javafx/embed/swing/RT30650GUI.java	Tue May 20 19:01:59 2014 +0400
+++ b/tests/system/src/test/java/javafx/embed/swing/RT30650GUI.java	Tue May 20 21:08:09 2014 +0400
@@ -55,8 +55,9 @@
     
     private final static int SIZE = 400;
     
-    private static int pulseCount = 100;
-    private static boolean passed;
+    // 100 pulses is not enough for the interop case, so we wait for 400 instead
+    private static int pulseCount = 400;
+    private static volatile boolean passed;
         
     public static boolean test() {
         launch(new String[]{});
@@ -93,26 +94,30 @@
                 panel.setBackground(Color.RED);
                 swingNode.setContent(panel);
                 
-                pulseListener = new TKPulseListener() {
-                    @Override
-                    public void pulse() {
-                        if (--pulseCount == 0) {
-                            SwingUtilities.invokeLater(new Runnable() {
-                                @Override
-                                public void run() {
-                                    passed = testColor(stage);
-                                    Platform.runLater(new Runnable() {
+                Platform.runLater(new Runnable() {
+                    @Override public void run() {
+                        pulseListener = new TKPulseListener() {
+                            @Override
+                            public void pulse() {
+                                if (--pulseCount == 0) {
+                                    SwingUtilities.invokeLater(new Runnable() {
                                         @Override
                                         public void run() {
-                                            stage.close();
+                                            passed = testColor(stage);
+                                            Platform.runLater(new Runnable() {
+                                                @Override
+                                                public void run() {
+                                                    stage.close();
+                                                }
+                                            });
                                         }
                                     });
                                 }
-                            });
-                        }
+                            }
+                        };
+                        com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(pulseListener);
                     }
-                };
-                com.sun.javafx.tk.Toolkit.getToolkit().addSceneTkPulseListener(pulseListener);
+                });
             }
         });        
     }
--- a/tests/system/src/test/java/javafx/embed/swing/RT30650Test.java	Tue May 20 19:01:59 2014 +0400
+++ b/tests/system/src/test/java/javafx/embed/swing/RT30650Test.java	Tue May 20 21:08:09 2014 +0400
@@ -25,9 +25,7 @@
 
 package javafx.embed.swing;
 
-import com.sun.javafx.PlatformUtil;
 import junit.framework.Assert;
-import org.junit.Assume;
 import org.junit.Test;
 
 /**
@@ -37,9 +35,6 @@
     
     @Test(timeout=10000)
     public void test() {
-        // Skip test on Windows until RT-36285 is fixed
-        Assume.assumeTrue(!PlatformUtil.isWindows());
-
         Assert.assertTrue(RT30650GUI.test());
         
         System.out.println("Passed.");