changeset 492:be6c16803717 draft

Six new tests added into CAGOperationsOnChordAndRectangle test suite.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Fri, 29 Nov 2013 09:50:49 +0100
parents 761954b1d3e1
children 712591ecc9d1
files ChangeLog src/org/gfxtest/testsuites/CAGOperationsOnChordAndRectangle.java
diffstat 2 files changed, 147 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 28 10:01:21 2013 +0100
+++ b/ChangeLog	Fri Nov 29 09:50:49 2013 +0100
@@ -1,3 +1,8 @@
+2013-11-29  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/gfxtest/testsuites/CAGOperationsOnChordAndRectangle.java:
+	Six new tests added into CAGOperationsOnChordAndRectangle test suite.
+
 2013-11-28  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/gfxtest/framework/CommonCAGOperations.java:
--- a/src/org/gfxtest/testsuites/CAGOperationsOnChordAndRectangle.java	Thu Nov 28 10:01:21 2013 +0100
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnChordAndRectangle.java	Fri Nov 29 09:50:49 2013 +0100
@@ -102,6 +102,148 @@
     }
 
     /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using intersect operator. The shape
+     * is rendered using stroke paint.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleIntersectStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingIntersectOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using subtract operator. The shape
+     * is rendered using stroke paint.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleSubtractStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using inverse subtract operator.
+     * The shape is rendered using stroke paint.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleInverseSubtractStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using inverse subtract operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingInverseSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using Xor operator.
+     * The shape is rendered using stroke paint.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleXorStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using XOR operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingXorOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using union operator. The shape is
+     * rendered using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleUnionWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingUnionOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from chord and rectangle using intersect operator. The shape
+     * is rendered using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBigChordRectangleIntersectWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromBiggerChordAndRectangleUsingIntersectOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
      * Entry point to the test suite.
      *
      * @param args not used in this case