< prev index next >

tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/TouchButtonTest.java

Print this page
rev 9504 : need to fix test log and others

@@ -23,11 +23,11 @@
  * questions.
  */
 
 package test.robot.com.sun.glass.ui.monocle;
 
-import com.sun.glass.ui.monocle.TestLog;
+import com.sun.glass.ui.monocle.TestLogShim;
 import test.robot.com.sun.glass.ui.monocle.TestApplication;
 import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
 import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
 import javafx.geometry.BoundingBox;
 import javafx.geometry.Bounds;

@@ -65,15 +65,15 @@
         button.setLayoutX(x);
         button.setLayoutY(y);
         button.setOnMousePressed((e) -> button.requestFocus());
         if (setListeners) {
             button.addEventHandler(MouseEvent.ANY, e ->
-                TestLog.log(e.getEventType().getName() +": " 
+                TestLogShim.log(e.getEventType().getName() +": " 
                                                      + (int) e.getScreenX()
                                                      + ", " + (int) e.getScreenY()));
             button.focusedProperty().addListener((observable, oldValue, newValue) ->
-                    TestLog.log(button.getId() + " isFocused=" + newValue));
+                    TestLogShim.log(button.getId() + " isFocused=" + newValue));
         }
 
         return button;
     }
 

@@ -123,20 +123,20 @@
     }
 
     @Test
     public void tapOutAndInButton() throws Exception {
         tapOutSideButton();
-        TestLog.reset();
+        TestLogShim.reset();
         Point2D clickAt = tapInsideButton(button1);
         waitForMouseClickAt(clickAt);
         waitForFocusGainOn("button1");
     }
 
     @Test
     public void tapOutInAndOutButton() throws Exception {
         tapOutSideButton();
-        TestLog.reset();
+        TestLogShim.reset();
         Point2D clickAt = tapInsideButton(button1);
         waitForMouseClickAt(clickAt);
         waitForFocusGainOn("button1");
 
         tapOutSideButton();

@@ -145,31 +145,31 @@
     }
 
     @Test
     public void tapInAndOutLoop() throws Exception {
         tapOutSideButton();
-        TestLog.reset();
+        TestLogShim.reset();
         for (int i = 0 ; i < 2 ; i++) {
             tapOutSideButton();
             tapInsideButton(button3);
-            TestLog.reset();
+            TestLogShim.reset();
             Point2D clickAt = tapInsideButton(button1);
             waitForFocusGainOn("button1");
             waitForMouseEnteredAt(clickAt);
             waitForMouseClickAt(clickAt);
 
             tapOutSideButton();
             tapInsideButton(button3);
             waitForFocusLostOn("button1");
-            TestLog.reset();
+            TestLogShim.reset();
 
             clickAt = tapInsideButton(button2);
             waitForFocusGainOn("button2");
             waitForMouseEnteredAt(clickAt);
 
             waitForMouseClickAt(clickAt);
-            TestLog.reset();
+            TestLogShim.reset();
             tapOutSideButton();
             tapInsideButton(button3);
             waitForFocusLostOn("button2");
         }
     }

@@ -199,12 +199,12 @@
         }
 
         //release inside the button
         device.removePoint(p);
         device.sync();
-        TestLog.waitForLogContaining("MOUSE_CLICKED:", 3000l);
-        TestLog.waitForLogContaining("MOUSE_RELEASED:", 3000l);
+        TestLogShim.waitForLogContaining("MOUSE_CLICKED:", 3000l);
+        TestLogShim.waitForLogContaining("MOUSE_RELEASED:", 3000l);
     }
 
     /**
      * RT-34625 - Currently a control will not generate a click when tapping on 
      * it, drag the finger outside the control and release the finger. 

@@ -237,11 +237,11 @@
         }
 
         //release outside the button
         device.removePoint(p);
         device.sync();
-        TestLog.waitForLogContaining("MOUSE_CLICKED:", 3000l);
+        TestLogShim.waitForLogContaining("MOUSE_CLICKED:", 3000l);
     }
 
     @Test
     public void tapping_oneButtonOnScreen () throws Exception {
         AtomicReference<Node> buttonRef = new AtomicReference<>();

@@ -254,11 +254,11 @@
         TestApplication.waitForLayout();
 
         for (int i = 0; i < 5; i++) {
             Point2D clickAt = tapInsideButton(buttonRef.get());
             waitForMouseClickAt(clickAt);
-            TestLog.reset();
+            TestLogShim.reset();
         }
     }
     
     /** utilities */
     public Bounds getButtonBounds(Node button) throws Exception {

@@ -266,11 +266,11 @@
         TestRunnable.invokeAndWait(() -> {
             ref.set(button.localToScreen(
                     new BoundingBox(0, 0,
                                     button.getBoundsInParent().getWidth(),
                                     button.getBoundsInParent().getHeight())));
-            TestLog.log("Bounds for " + button.getId() + " are " + ref.get());
+            TestLogShim.log("Bounds for " + button.getId() + " are " + ref.get());
         });
         return ref.get();
     }
 
     public Point2D getCenterOfButton(Node button) throws Exception {

@@ -287,11 +287,11 @@
         int p = device.addPoint(clickAt.getX(), clickAt.getY());
         device.sync();
         //release
         device.removePoint(p);
         device.sync();
-        TestLog.waitForLog("Mouse clicked: %.0f, %.0f", clickAt.getX(), clickAt.getY());
+        TestLogShim.waitForLog("Mouse clicked: %.0f, %.0f", clickAt.getX(), clickAt.getY());
         return clickAt;
     }
 
     public void tapOutSideButton() throws Exception {
         Bounds buttonBounds = getButtonBounds(button3);

@@ -301,27 +301,27 @@
         int p = device.addPoint(x, y);
         device.sync();
         //release
         device.removePoint(p);
         device.sync();
-        TestLog.waitForLog("Mouse clicked: %.0f, %.0f", x, y);
+        TestLogShim.waitForLog("Mouse clicked: %.0f, %.0f", x, y);
     }
 
     public void waitForMouseClickAt(Point2D clickAt) throws Exception{
-        TestLog.waitForLog("MOUSE_CLICKED: %d, %d",
+        TestLogShim.waitForLog("MOUSE_CLICKED: %d, %d",
                            Math.round(clickAt.getX()),
                            Math.round(clickAt.getY()));
     }
 
     public void waitForMouseEnteredAt(Point2D clickAt) throws Exception{
-        TestLog.waitForLog("MOUSE_ENTERED: %d, %d",
+        TestLogShim.waitForLog("MOUSE_ENTERED: %d, %d",
                            Math.round(clickAt.getX()),
                            Math.round(clickAt.getY()));
     }
 
     public void waitForFocus(String id, boolean focusState) throws Exception {
-        TestLog.waitForLog("%s isFocused=%b", id, focusState);
+        TestLogShim.waitForLog("%s isFocused=%b", id, focusState);
     }
 
     public void waitForFocusGainOn(String id) throws Exception{
         waitForFocus(id, true);
     }
< prev index next >