/hg/gfx-test: * src/org/gfxtest/testsuites/PrintTestArcs.java:
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Jun 15 05:16:48 PDT 2012
changeset ca41265056e8 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=ca41265056e8
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jun 15 14:19:25 2012 +0200
* src/org/gfxtest/testsuites/PrintTestArcs.java:
Added nine new tests to this test suite.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/testsuites/PrintTestArcs.java | 477 ++++++++++++++++++++++++++
2 files changed, 482 insertions(+), 0 deletions(-)
diffs (499 lines):
diff -r 3604f4097f70 -r ca41265056e8 ChangeLog
--- a/ChangeLog Thu Jun 14 14:58:22 2012 +0200
+++ b/ChangeLog Fri Jun 15 14:19:25 2012 +0200
@@ -1,3 +1,8 @@
+2012-06-15 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/testsuites/PrintTestArcs.java:
+ Added nine new tests to this test suite.
+
2012-06-14 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/PrintTestArcs.java:
diff -r 3604f4097f70 -r ca41265056e8 src/org/gfxtest/testsuites/PrintTestArcs.java
--- a/src/org/gfxtest/testsuites/PrintTestArcs.java Thu Jun 14 14:58:22 2012 +0200
+++ b/src/org/gfxtest/testsuites/PrintTestArcs.java Fri Jun 15 14:19:25 2012 +0200
@@ -687,6 +687,483 @@
}
/**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapButtJoinBevelInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapRoundJoinBevelInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapSquareJoinBevelInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to miter style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapButtJoinMiterInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to miter style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapRoundJoinMiterInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to miter style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapSquareJoinMiterInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_BUTT.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapButtJoinRoundInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_ROUND.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapRoundJoinRoundInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test basic behavior of method Graphics.drawOval().
+ * Arcs are rendered with various width and end caps set to CAP_SQUARE.
+ * Join style is set to bevel style.
+ * Color of all rendered arcs are set to black.
+ *
+ * @param image
+ * image to which arcs are to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testDrawArcChangeWidthCapSquareJoinRoundInv(TestImage image, Graphics2D graphics2d)
+ {
+ drawArcs(image, graphics2d, ARC_RADIUS_STEP * 3 / 2, new CommonArcDrawCallbacks()
+ {
+ /**
+ * Stroke width which is changed in each iteration.
+ */
+ private float strokeWidth = MAX_STROKE_WIDTH - 2;
+
+ /**
+ * Callback function called before each arc is rendered.
+ */
+ @Override
+ public void iterationCallBack(int x, int y, int radius, int maxRadius, int index)
+ {
+ // set stroke width and style
+ this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
+ // change stroke width for the next iteration
+ changeStrokeWidth();
+ return;
+ }
+
+ /**
+ * Changes stroke width.
+ */
+ private void changeStrokeWidth()
+ {
+ // decrease stroke width
+ this.strokeWidth -= STROKE_WIDTH_DELTA;
+ // stroke width should not be less than zero
+ if (this.strokeWidth < MIN_STROKE_WIDTH)
+ {
+ this.strokeWidth = MIN_STROKE_WIDTH;
+ }
+ }
+ });
+
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args
More information about the distro-pkg-dev
mailing list