< prev index next >

tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/RotateTest.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.ParameterizedTestBase; import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevice; import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevices; import org.junit.After; import org.junit.Assert; --- 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.ParameterizedTestBase; import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevice; import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevices; import org.junit.After; import org.junit.Assert;
*** 74,84 **** } @After public void releaseAll() throws Exception { if (device.getPressedPoints() == 2) { ! TestLog.reset(); device.removePoint(p1); device.removePoint(p2); device.sync(); } } --- 74,84 ---- } @After public void releaseAll() throws Exception { if (device.getPressedPoints() == 2) { ! TestLogShim.reset(); device.removePoint(p1); device.removePoint(p2); device.sync(); } }
*** 111,127 **** int numOfIterations) throws Exception { int totalAngle = angleStep; updateNewTouchPoint(startAngle, radius, x2, y2); ! TestLog.reset(); p1 = device.addPoint(newX1, newY1); p2 = device.addPoint(x2, y2); device.sync(); //verify pressing two fingers ! TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d", newX1, newY1); ! TestLog.waitForLogContaining("TouchPoint: PRESSED %d, %d", x2, y2); //saving previous coordinates: int previousX = newX1; int previousY = newY1; --- 111,127 ---- int numOfIterations) throws Exception { int totalAngle = angleStep; updateNewTouchPoint(startAngle, radius, x2, y2); ! TestLogShim.reset(); p1 = device.addPoint(newX1, newY1); p2 = device.addPoint(x2, y2); device.sync(); //verify pressing two fingers ! TestLogShim.waitForLogContaining("TouchPoint: PRESSED %d, %d", newX1, newY1); ! TestLogShim.waitForLogContaining("TouchPoint: PRESSED %d, %d", x2, y2); //saving previous coordinates: int previousX = newX1; int previousY = newY1;
*** 129,165 **** Assume.assumeTrue(getDistance(previousX, previousY, newX1, newY1 ) > device.getTapRadius()); //start the rotation ! TestLog.reset(); device.setPoint(p1, newX1, newY1); device.sync(); ! TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", newX1, newY1); ! TestLog.waitForLogContaining("TouchPoint: STATIONARY %d, %d", x2, y2); if (Math.abs(angleStep) >= getRotateThreshold()) { ! TestLog.waitForLogContaining("Rotation started, angle: " + ZERO_ANGLE + ", total angle: " + ZERO_ANGLE + ", inertia value: false"); ! TestLog.waitForLogContaining("Rotation, angle: " + angleStep + ", total angle: " + totalAngle + ", inertia value: false"); } else { ! Assert.assertEquals(0, TestLog.countLogContaining("Rotation started")); ! Assert.assertEquals(0, TestLog.countLogContaining("Rotation, angle")); } boolean passedTheThreshold =false; if (numOfIterations >= 2) { for (int i = 2; i <= numOfIterations; i++) { updateNewTouchPoint(angleStep * i + startAngle, radius, x2, y2); totalAngle += angleStep; ! TestLog.reset(); device.setPoint(p1, newX1, newY1); device.sync(); ! TestLog.waitForLogContaining("TouchPoint: MOVED %d, %d", newX1, newY1); ! TestLog.waitForLogContaining("TouchPoint: STATIONARY %d, %d", x2, y2); String expectedLog; if (Math.abs(angleStep) < getRotateThreshold()) { if(Math.abs(totalAngle) >= getRotateThreshold()) { if (!passedTheThreshold) { --- 129,165 ---- Assume.assumeTrue(getDistance(previousX, previousY, newX1, newY1 ) > device.getTapRadius()); //start the rotation ! TestLogShim.reset(); device.setPoint(p1, newX1, newY1); device.sync(); ! TestLogShim.waitForLogContaining("TouchPoint: MOVED %d, %d", newX1, newY1); ! TestLogShim.waitForLogContaining("TouchPoint: STATIONARY %d, %d", x2, y2); if (Math.abs(angleStep) >= getRotateThreshold()) { ! TestLogShim.waitForLogContaining("Rotation started, angle: " + ZERO_ANGLE + ", total angle: " + ZERO_ANGLE + ", inertia value: false"); ! TestLogShim.waitForLogContaining("Rotation, angle: " + angleStep + ", total angle: " + totalAngle + ", inertia value: false"); } else { ! Assert.assertEquals(0, TestLogShim.countLogContaining("Rotation started")); ! Assert.assertEquals(0, TestLogShim.countLogContaining("Rotation, angle")); } boolean passedTheThreshold =false; if (numOfIterations >= 2) { for (int i = 2; i <= numOfIterations; i++) { updateNewTouchPoint(angleStep * i + startAngle, radius, x2, y2); totalAngle += angleStep; ! TestLogShim.reset(); device.setPoint(p1, newX1, newY1); device.sync(); ! TestLogShim.waitForLogContaining("TouchPoint: MOVED %d, %d", newX1, newY1); ! TestLogShim.waitForLogContaining("TouchPoint: STATIONARY %d, %d", x2, y2); String expectedLog; if (Math.abs(angleStep) < getRotateThreshold()) { if(Math.abs(totalAngle) >= getRotateThreshold()) { if (!passedTheThreshold) {
*** 178,218 **** } else { expectedLog = "Rotation, angle: " + angleStep + ", total angle: " + totalAngle + ", inertia value: false"; } ! TestLog.waitForLogContaining(expectedLog); } } ! TestLog.reset(); device.removePoint(p1); device.removePoint(p2); device.sync(); //verify fingers release ! TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", newX1, newY1); ! TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", x2, y2); if (Math.abs(totalAngle) >= getRotateThreshold()) { ! TestLog.waitForLogContaining("Rotation finished, angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false"); ! Assert.assertEquals(1, TestLog.countLogContaining("Rotation " + "finished, " + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false")); } else { ! Assert.assertEquals(0, TestLog.countLogContaining("Rotation finished, " + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false")); } ! if (TestLog.countLogContaining("Rotation finished") > 0) { ! TestLog.waitForLogContainingSubstrings("Rotation", "inertia value: true"); } ! TestLog.reset(); p2 = device.addPoint(x2, y2); device.sync(); device.removePoint(p2); device.sync(); ! TestLog.waitForLogContaining("TouchPoint: RELEASED %d, %d", x2, y2); } private void Rotate(int radius, int x2, int y2, int angleStep, int numOfIterations) throws Exception { Rotate(0, radius, x2, y2, angleStep, numOfIterations); --- 178,218 ---- } else { expectedLog = "Rotation, angle: " + angleStep + ", total angle: " + totalAngle + ", inertia value: false"; } ! TestLogShim.waitForLogContaining(expectedLog); } } ! TestLogShim.reset(); device.removePoint(p1); device.removePoint(p2); device.sync(); //verify fingers release ! TestLogShim.waitForLogContaining("TouchPoint: RELEASED %d, %d", newX1, newY1); ! TestLogShim.waitForLogContaining("TouchPoint: RELEASED %d, %d", x2, y2); if (Math.abs(totalAngle) >= getRotateThreshold()) { ! TestLogShim.waitForLogContaining("Rotation finished, angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false"); ! Assert.assertEquals(1, TestLogShim.countLogContaining("Rotation " + "finished, " + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false")); } else { ! Assert.assertEquals(0, TestLogShim.countLogContaining("Rotation finished, " + "angle: " + ZERO_ANGLE + ", total angle: " + totalAngle + ", inertia value: false")); } ! if (TestLogShim.countLogContaining("Rotation finished") > 0) { ! TestLogShim.waitForLogContainingSubstrings("Rotation", "inertia value: true"); } ! TestLogShim.reset(); p2 = device.addPoint(x2, y2); device.sync(); device.removePoint(p2); device.sync(); ! TestLogShim.waitForLogContaining("TouchPoint: RELEASED %d, %d", x2, y2); } private void Rotate(int radius, int x2, int y2, int angleStep, int numOfIterations) throws Exception { Rotate(0, radius, x2, y2, angleStep, numOfIterations);
< prev index next >