changeset 42:be861684d20d

Mac fix
author Alexandre (Shura) Iline <alexandre.iline@sun.com>
date Wed, 27 Jun 2012 16:57:53 +0400
parents a8fbe90bc84e
children 6a2624036241
files tools/Jemmy/JemmyFX/build.xml tools/Jemmy/JemmyFX/samples/org/jemmy/samples/accordion/AccordionSample.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/buttons/ButtonsSample.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/EnvironmentSample.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/TimeoutsSample.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/input/InputSampleBase.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/lookup/LookupSampleBase.java tools/Jemmy/JemmyFX/samples/org/jemmy/samples/text/TextSample.java tools/Jemmy/JemmyFX/src/org/jemmy/fx/Root.java
diffstat 9 files changed, 32 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/tools/Jemmy/JemmyFX/build.xml	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/build.xml	Wed Jun 27 16:57:53 2012 +0400
@@ -69,12 +69,11 @@
             unless="no.need.to.copy.jemmy.libs">
         <mkdir dir="${jemmy.lib.dir}"/>
         <property name="jemmy.download.url" value="http://jemmy.java.net/dist"/>
+        <get src="${jemmy.download.url}/junit.jar" dest="${jemmy.lib.dir}"/>
         <property name="dist.url" value="${jemmy.download.url}/${jemmy.core.version}"/>
-        <!--get src="${dist.url}/jemmy.jar" dest="${jemmy.lib.dir}"/-->
         <get src="${dist.url}/JemmyCore.jar" dest="${jemmy.lib.dir}"/>
         <get src="${dist.url}/JemmyAWTInput.jar" dest="${jemmy.lib.dir}"/>
         <get src="${dist.url}/JemmyBrowser.jar" dest="${jemmy.lib.dir}"/>
-        <get src="${dist.url}/junit.jar" dest="${jemmy.lib.dir}"/>
     </target>
     <target name="set-javafx-home" if="javafx.home">
         <echo file="build.properties" message="javafx.home=${javafx.home}"/>
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/accordion/AccordionSample.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/accordion/AccordionSample.java	Wed Jun 27 16:57:53 2012 +0400
@@ -32,17 +32,18 @@
 import org.jemmy.fx.control.LabeledDock;
 import org.jemmy.fx.control.TitledPaneDock;
 import org.jemmy.resources.StringComparePolicy;
+import org.jemmy.samples.SampleBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class AccordionSample {
+public class AccordionSample extends SampleBase {
     static SceneDock scene;
     
     @BeforeClass
-    public static void launch() {
-        AppExecutor.executeNoBlock(AccordionApp.class);
+    public static void launch() throws InterruptedException {
+        startApp(AccordionApp.class);
         scene = new SceneDock();
     }
 
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/buttons/ButtonsSample.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/buttons/ButtonsSample.java	Wed Jun 27 16:57:53 2012 +0400
@@ -34,6 +34,7 @@
 import org.jemmy.fx.control.LabeledDock;
 import org.jemmy.fx.control.ToggleButtonDock;
 import org.jemmy.resources.StringComparePolicy;
+import org.jemmy.samples.SampleBase;
 import static org.junit.Assert.assertEquals;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -42,14 +43,14 @@
  * How to use buttons: buttons, check boxes, radio buttons.
  * @author shura
  */
-public class ButtonsSample {
+public class ButtonsSample extends SampleBase {
 
     private static SceneDock scene;
     private static LabeledDock status;
     
     @BeforeClass
-    public static void startApp() {
-        AppExecutor.executeNoBlock(ButtonsApp.class);
+    public static void startApp() throws InterruptedException {
+        startApp(ButtonsApp.class);
         scene = new SceneDock();
         status = new LabeledDock(scene.asParent(), "status");
     }
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/EnvironmentSample.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/EnvironmentSample.java	Wed Jun 27 16:57:53 2012 +0400
@@ -30,6 +30,7 @@
 import org.jemmy.fx.NodeDock;
 import org.jemmy.fx.Root;
 import org.jemmy.fx.SceneDock;
+import org.jemmy.samples.SampleBase;
 import org.jemmy.samples.lookup.LookupApp;
 import org.jemmy.samples.lookup.LookupSample;
 import static org.junit.Assert.*;
@@ -41,7 +42,7 @@
  *
  * @author shura
  */
-public class EnvironmentSample {
+public class EnvironmentSample extends SampleBase {
 
     private static SceneDock scene;
     private static NodeDock parent;
@@ -49,8 +50,8 @@
     private static NodeDock node2;
 
     @BeforeClass
-    public static void runApp() {
-        AppExecutor.executeNoBlock(LookupApp.class);
+    public static void runApp() throws InterruptedException {
+        startApp(LookupApp.class);
         scene = new SceneDock();
         parent = new NodeDock(scene.asParent(), GridPane.class);
         node1 = new NodeDock(parent.asParent(), "lbl_00");
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/TimeoutsSample.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/environment/TimeoutsSample.java	Wed Jun 27 16:57:53 2012 +0400
@@ -30,6 +30,7 @@
 import org.jemmy.fx.Root;
 import org.jemmy.fx.SceneDock;
 import org.jemmy.interfaces.Mouse;
+import org.jemmy.samples.SampleBase;
 import org.jemmy.samples.lookup.LookupApp;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -41,13 +42,13 @@
  * Please consult component specific samples to learn component specific timeouts
  * @author shura
  */
-public class TimeoutsSample {
+public class TimeoutsSample extends SampleBase {
     private static SceneDock scene;
     private static NodeDock node;
     
     @BeforeClass
-    public static void runApp() {
-        AppExecutor.executeNoBlock(LookupApp.class);
+    public static void runApp() throws InterruptedException {
+        startApp(LookupApp.class);
         scene = new SceneDock();
         node = new NodeDock(scene.asParent(), "lbl_01");
     }
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/input/InputSampleBase.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/input/InputSampleBase.java	Wed Jun 27 16:57:53 2012 +0400
@@ -38,7 +38,9 @@
 import org.jemmy.fx.NodeDock;
 import org.jemmy.fx.Root;
 import org.jemmy.fx.SceneDock;
+import org.jemmy.input.AWTRobotInputFactory;
 import org.jemmy.lookup.LookupCriteria;
+import org.jemmy.samples.SampleBase;
 import org.jemmy.timing.State;
 import org.junit.After;
 import org.junit.BeforeClass;
@@ -47,15 +49,15 @@
  *
  * @author shura
  */
-public class InputSampleBase {
+public class InputSampleBase extends SampleBase {
 
     protected static SceneDock scene;
     protected static NodeDock redTarget;
     protected static NodeDock blueTarget;
 
     @BeforeClass
-    public static void before() {
-        AppExecutor.executeNoBlock(InputApp.class);
+    public static void before() throws InterruptedException {
+        startApp(InputApp.class);
         scene = new SceneDock();
         redTarget = new NodeDock(scene.asParent(), Rectangle.class, new TargetCriteria(Color.RED));
         blueTarget = new NodeDock(scene.asParent(), Rectangle.class, new TargetCriteria(Color.BLUE));
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/lookup/LookupSampleBase.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/lookup/LookupSampleBase.java	Wed Jun 27 16:57:53 2012 +0400
@@ -27,6 +27,7 @@
 import org.jemmy.control.Wrap;
 import org.jemmy.fx.AppExecutor;
 import org.jemmy.fx.Root;
+import org.jemmy.samples.SampleBase;
 import org.jemmy.timing.State;
 import org.junit.After;
 import org.junit.BeforeClass;
@@ -36,10 +37,10 @@
  *
  * @author shura
  */
-public class LookupSampleBase {
+public class LookupSampleBase extends SampleBase {
     @BeforeClass
     public static void setUpClass() throws Exception {
-        AppExecutor.executeNoBlock(LookupApp.class);
+        startApp(LookupApp.class);
     }
     
     @After
--- a/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/text/TextSample.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/samples/org/jemmy/samples/text/TextSample.java	Wed Jun 27 16:57:53 2012 +0400
@@ -31,6 +31,7 @@
 import org.jemmy.fx.control.LabeledDock;
 import org.jemmy.fx.control.TextInputControlDock;
 import org.jemmy.resources.StringComparePolicy;
+import org.jemmy.samples.SampleBase;
 import static org.junit.Assert.assertTrue;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -42,12 +43,12 @@
  * 
  * @author shura
  */
-public class TextSample {
+public class TextSample extends SampleBase {
 
     static SceneDock scene;
     @BeforeClass
-    public static void launch() {
-        AppExecutor.executeNoBlock(TextApp.class);
+    public static void launch() throws InterruptedException {
+        startApp(TextApp.class);
         scene = new SceneDock();
     }
     
--- a/tools/Jemmy/JemmyFX/src/org/jemmy/fx/Root.java	Wed Jun 27 12:34:02 2012 +0400
+++ b/tools/Jemmy/JemmyFX/src/org/jemmy/fx/Root.java	Wed Jun 27 16:57:53 2012 +0400
@@ -24,7 +24,6 @@
  */
 package org.jemmy.fx;
 
-import java.util.Locale;
 import javafx.scene.Scene;
 import org.jemmy.action.ActionExecutor;
 import org.jemmy.control.Wrapper;
@@ -83,14 +82,13 @@
         env.setProperty(ImageComparator.class, new BufferedImageComparator(env));
         env.setProperty(ImageLoader.class, new FileGlassImageLoader());
     }
-    
+
     private Root() {
         this.env = new Environment(Environment.getEnvironment());
         this.env.setPropertyIfNotSet(RasterComparator.class, new PixelEqualityRasterComparator(0));
         String osName = System.getProperty("os.name").toLowerCase();
-        if(osName.contains("nux") || osName.contains("nix") || osName.contains("sunos")) {
-            //until glassrobot works reliably
-            useAWTRobot(this.env);
+        if(osName.contains("nux") || osName.contains("nix") || osName.contains("sunos") ||  osName.contains("mac os")) {
+            useAWTRobot(env);
         } else {
             useGlassRobot(this.env);
         }