< prev index next >

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

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

*** 23,33 **** * questions. */ package test.robot.com.sun.glass.ui.monocle; ! import com.sun.glass.ui.monocle.TestLog; 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 com.sun.javafx.PlatformUtil; import javafx.scene.input.GestureEvent; --- 23,33 ---- * questions. */ package test.robot.com.sun.glass.ui.monocle; ! 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 com.sun.javafx.PlatformUtil; import javafx.scene.input.GestureEvent;
*** 119,129 **** } public SwipeTest(TestTouchDevice device, SwipeTestCase testCase) throws Exception { super(device); this.testCase = testCase; ! TestLog.format("Starting test with %s, %s", device, testCase); TestApplication.getStage(); TestRunnable.invokeAndWait(() -> { Assume.assumeTrue( TestApplication.isMonocle() || TestApplication.isLens()); Assume.assumeTrue(PlatformUtil.isEmbedded()); --- 119,129 ---- } public SwipeTest(TestTouchDevice device, SwipeTestCase testCase) throws Exception { super(device); this.testCase = testCase; ! TestLogShim.format("Starting test with %s, %s", device, testCase); TestApplication.getStage(); TestRunnable.invokeAndWait(() -> { Assume.assumeTrue( TestApplication.isMonocle() || TestApplication.isLens()); Assume.assumeTrue(PlatformUtil.isEmbedded());
*** 144,154 **** @Before public void addListener() throws Exception { TestApplication.getStage().getScene().addEventHandler( GestureEvent.ANY, ! e -> TestLog.format("%s at %.0f, %.0f", e.getEventType(), e.getScreenX(), e.getScreenY())); } --- 144,154 ---- @Before public void addListener() throws Exception { TestApplication.getStage().getScene().addEventHandler( GestureEvent.ANY, ! e -> TestLogShim.format("%s at %.0f, %.0f", e.getEventType(), e.getScreenX(), e.getScreenY())); }
*** 231,249 **** testCase.amplitude, testCase.wavelength).await(); // release device.removePoint(p); device.sync(); ! TestLog.waitForLog("Mouse pressed: %d, %d", x, y); ! TestLog.waitForLogContaining("Mouse released"); ! TestLog.waitForLogContaining("Mouse clicked"); ! TestLog.waitForLogContaining("Touch pressed"); ! TestLog.waitForLogContaining("Touch released"); if (testCase.expectedSwipe == null) { ! Assert.assertEquals(0, TestLog.countLogContaining("SWIPE")); } else { ! TestLog.waitForLogContaining(testCase.expectedSwipe); ! Assert.assertEquals(1, TestLog.countLogContaining("SWIPE")); } } } --- 231,249 ---- testCase.amplitude, testCase.wavelength).await(); // release device.removePoint(p); device.sync(); ! TestLogShim.waitForLog("Mouse pressed: %d, %d", x, y); ! TestLogShim.waitForLogContaining("Mouse released"); ! TestLogShim.waitForLogContaining("Mouse clicked"); ! TestLogShim.waitForLogContaining("Touch pressed"); ! TestLogShim.waitForLogContaining("Touch released"); if (testCase.expectedSwipe == null) { ! Assert.assertEquals(0, TestLogShim.countLogContaining("SWIPE")); } else { ! TestLogShim.waitForLogContaining(testCase.expectedSwipe); ! Assert.assertEquals(1, TestLogShim.countLogContaining("SWIPE")); } } }
< prev index next >