/hg/gfx-test: Added 14 new tests to the test suite
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Wed Oct 10 04:39:40 PDT 2012
changeset 496ca6dc09af in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=496ca6dc09af
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Oct 10 12:54:14 2012 +0200
Added 14 new tests to the test suite
src/org/gfxtest/testsuites/PrintTestTexturePaint.java.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/testsuites/PrintTestTexturePaint.java | 316 +++++++++++++++++-
2 files changed, 320 insertions(+), 1 deletions(-)
diffs (357 lines):
diff -r 26cb5bb2ccf5 -r 496ca6dc09af ChangeLog
--- a/ChangeLog Tue Oct 09 09:24:59 2012 +0200
+++ b/ChangeLog Wed Oct 10 12:54:14 2012 +0200
@@ -1,3 +1,8 @@
+2012-10-10 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/testsuites/PrintTestTexturePaint.java:
+ Added 14 new tests to this test suite.
+
2012-10-09 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/PrintTestCubicCurves.java:
diff -r 26cb5bb2ccf5 -r 496ca6dc09af src/org/gfxtest/testsuites/PrintTestTexturePaint.java
--- a/src/org/gfxtest/testsuites/PrintTestTexturePaint.java Tue Oct 09 09:24:59 2012 +0200
+++ b/src/org/gfxtest/testsuites/PrintTestTexturePaint.java Wed Oct 10 12:54:14 2012 +0200
@@ -40,7 +40,15 @@
package org.gfxtest.testsuites;
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.CommonRenderingStyles;
+import org.gfxtest.framework.CommonShapesRenderer;
import org.gfxtest.framework.PrintTest;
+import org.gfxtest.framework.TestImage;
+import org.gfxtest.framework.TestResult;
import org.gfxtest.framework.annotations.RenderStyle;
import org.gfxtest.framework.annotations.RenderStyles;
import org.gfxtest.framework.annotations.TestType;
@@ -56,7 +64,7 @@
*
* @author Pavel Tisnovsky
*/
- at TestType(TestTypes.RENDER_TEST)
+ at TestType(TestTypes.PRINT_TEST)
@RenderStyle(RenderStyles.FILL)
@Transformation(Transformations.NONE)
@Zoom(1)
@@ -64,6 +72,311 @@
{
/**
+ * Test if circle drawn by graphics.drawOval() is rendered correctly.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleEmptyFill(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // draw the circle
+ CommonShapesRenderer.drawCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingCheckerTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingCheckerTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingDiagonalCheckerTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingDiagonalCheckerTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingGridTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingGridTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingDiagonalGridTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingDiagonalGridTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingHorizontalStripesTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingHorizontalStripesTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingVerticalStripesTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingVerticalStripesTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingHorizontalColorStripesTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingHorizontalColorStripesTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingVerticalColorStripesTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingVerticalColorStripesTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingDiagonalStripesTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingDiagonalStripesTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingDotTexture(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color (it could not be used during the shape rendering)
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set texture
+ CommonRenderingStyles.setTextureFillUsingColorDotsTexture(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingRGBTexture1(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set fill color
+ CommonRenderingStyles.setTextureFillUsingRGBTexture1(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingRGBTexture2(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set fill color
+ CommonRenderingStyles.setTextureFillUsingRGBTexture2(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Test if filled circle drawn by graphics.fillOval() is rendered correctly.
+ * Texture paint is used for filling this circle.
+ *
+ * @param image
+ * image to which two dimensional shape is to be rendered
+ * @param graphics
+ * graphics context for image
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testCircleTexturePaintUsingRGBTexture3(TestImage image, Graphics2D graphics)
+ {
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics);
+ // set fill color
+ CommonRenderingStyles.setTextureFillUsingRGBTexture3(image, graphics);
+ // draw the circle
+ CommonShapesRenderer.drawFilledCircle(image, graphics);
+ // test return value
+ return TestResult.PASSED;
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args
@@ -74,3 +387,4 @@
new PrintTestTexturePaint().runTestSuite(args);
}
}
+
More information about the distro-pkg-dev
mailing list