< prev index next >
tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/SingleTouchNonFullScreenTest.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 javafx.geometry.Rectangle2D;
import javafx.scene.input.TouchEvent;
--- 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 javafx.geometry.Rectangle2D;
import javafx.scene.input.TouchEvent;
*** 72,82 ****
public SingleTouchNonFullScreenTest(TestTouchDevice device, TestCase testCase)
{
super(device, testCase.stageBounds);
this.testCase = testCase;
! TestLog.format("Starting test with %s, %s", device, testCase);
}
@Parameterized.Parameters
public static Collection<Object[]> data() {
List<Object[]> params = new ArrayList<>();
--- 72,82 ----
public SingleTouchNonFullScreenTest(TestTouchDevice device, TestCase testCase)
{
super(device, testCase.stageBounds);
this.testCase = testCase;
! TestLogShim.format("Starting test with %s, %s", device, testCase);
}
@Parameterized.Parameters
public static Collection<Object[]> data() {
List<Object[]> params = new ArrayList<>();
*** 91,114 ****
@Before
public void addListener() throws Exception {
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_PRESSED,
! e -> TestLog.format("Touch pressed [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY())
);
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_RELEASED,
! e -> TestLog.format("Touch released [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY()));
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_MOVED,
! e -> TestLog.format("Touch moved [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY()));
}
--- 91,114 ----
@Before
public void addListener() throws Exception {
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_PRESSED,
! e -> TestLogShim.format("Touch pressed [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY())
);
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_RELEASED,
! e -> TestLogShim.format("Touch released [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY()));
TestApplication.getStage().getScene().addEventHandler(
TouchEvent.TOUCH_MOVED,
! e -> TestLogShim.format("Touch moved [relative]: %.0f, %.0f",
e.getTouchPoint().getX(),
e.getTouchPoint().getY()));
}
*** 126,146 ****
int p = device.addPoint(x1, y1);
device.sync();
// release
device.removePoint(p);
device.sync();
! TestLog.waitForLog("Mouse pressed: %d, %d", x1, y1);
! TestLog.waitForLog("Mouse released: %d, %d", x1, y1);
! TestLog.waitForLog("Mouse clicked: %d, %d", x1, y1);
! TestLog.waitForLog("Touch pressed [relative]: %d, %d", relX1, relY1);
! TestLog.waitForLog("Touch pressed: %d, %d", x1, y1);
! TestLog.waitForLog("Touch released [relative]: %d, %d", relX1, relY1);
! TestLog.waitForLog("Touch released: %d, %d", x1, y1);
// Check that the touch event has one touch point.
Assert.assertEquals("Expected only one touch point", 0,
! TestLog.getLog().stream()
.filter(s -> s.startsWith("Touch points count"))
.filter(s -> !s.startsWith("Touch points count: [1]")).count());
}
/**
--- 126,146 ----
int p = device.addPoint(x1, y1);
device.sync();
// release
device.removePoint(p);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: %d, %d", x1, y1);
! TestLogShim.waitForLog("Mouse released: %d, %d", x1, y1);
! TestLogShim.waitForLog("Mouse clicked: %d, %d", x1, y1);
! TestLogShim.waitForLog("Touch pressed [relative]: %d, %d", relX1, relY1);
! TestLogShim.waitForLog("Touch pressed: %d, %d", x1, y1);
! TestLogShim.waitForLog("Touch released [relative]: %d, %d", relX1, relY1);
! TestLogShim.waitForLog("Touch released: %d, %d", x1, y1);
// Check that the touch event has one touch point.
Assert.assertEquals("Expected only one touch point", 0,
! TestLogShim.getLog().stream()
.filter(s -> s.startsWith("Touch points count"))
.filter(s -> !s.startsWith("Touch points count: [1]")).count());
}
/**
*** 163,184 ****
device.setPoint(p, x2, y2);
device.sync();
// release
device.removePoint(p);
device.sync();
! TestLog.waitForLog("Mouse pressed: %d, %d", x1, y1);
! TestLog.waitForLog("Mouse dragged: %d, %d", x2, y2);
! TestLog.waitForLog("Mouse released: %d, %d", x2, y2);
! TestLog.waitForLog("Mouse clicked: %d, %d", x2, y2);
! TestLog.waitForLog("Touch pressed [relative]: %d, %d", relX1, relY1);
! TestLog.waitForLog("Touch pressed: %d, %d", x1, y1);
! TestLog.waitForLog("Touch moved [relative]: %d, %d", relX2, relY2);
! TestLog.waitForLog("Touch moved: %d, %d", x2, y2);
! TestLog.waitForLog("Touch released [relative]: %d, %d", relX2, relY2);
! TestLog.waitForLog("Touch released: %d, %d", x2, y2);
// Check that the touch event has one touch point.
Assert.assertEquals("Expected only one touch point", 0,
! TestLog.getLog().stream()
.filter(s -> s.startsWith("Touch points count"))
.filter(s -> !s.startsWith("Touch points count: [1]")).count());
}
}
--- 163,184 ----
device.setPoint(p, x2, y2);
device.sync();
// release
device.removePoint(p);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: %d, %d", x1, y1);
! TestLogShim.waitForLog("Mouse dragged: %d, %d", x2, y2);
! TestLogShim.waitForLog("Mouse released: %d, %d", x2, y2);
! TestLogShim.waitForLog("Mouse clicked: %d, %d", x2, y2);
! TestLogShim.waitForLog("Touch pressed [relative]: %d, %d", relX1, relY1);
! TestLogShim.waitForLog("Touch pressed: %d, %d", x1, y1);
! TestLogShim.waitForLog("Touch moved [relative]: %d, %d", relX2, relY2);
! TestLogShim.waitForLog("Touch moved: %d, %d", x2, y2);
! TestLogShim.waitForLog("Touch released [relative]: %d, %d", relX2, relY2);
! TestLogShim.waitForLog("Touch released: %d, %d", x2, y2);
// Check that the touch event has one touch point.
Assert.assertEquals("Expected only one touch point", 0,
! TestLogShim.getLog().stream()
.filter(s -> s.startsWith("Touch points count"))
.filter(s -> !s.startsWith("Touch points count: [1]")).count());
}
}
< prev index next >