/hg/gfx-test: 2012-04-16 Pavel Tisnovsky <ptisnovs at redhat.com>

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Apr 16 02:25:20 PDT 2012


changeset 31509443dff8 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=31509443dff8
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Apr 16 11:27:52 2012 +0200

	2012-04-16  Pavel Tisnovsky  <ptisnovs at redhat.com>

		* src/org/gfxtest/testsuites/PrintTestBasic.java:
		Added first print test.
		* Makefile: Updated


diffstat:

 ChangeLog                                      |    6 +
 Makefile                                       |    6 +-
 src/org/gfxtest/testsuites/PrintTestBasic.java |  107 +++++++++++++++++++++++++
 3 files changed, 117 insertions(+), 2 deletions(-)

diffs (147 lines):

diff -r cba2ae48526e -r 31509443dff8 ChangeLog
--- a/ChangeLog	Fri Apr 13 14:15:12 2012 +0200
+++ b/ChangeLog	Mon Apr 16 11:27:52 2012 +0200
@@ -1,3 +1,9 @@
+2012-04-16  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/PrintTestBasic.java:
+	Added first print test.
+	* Makefile: Updated
+
 2012-04-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/GfxTest.java:
diff -r cba2ae48526e -r 31509443dff8 Makefile
--- a/Makefile	Fri Apr 13 14:15:12 2012 +0200
+++ b/Makefile	Mon Apr 16 11:27:52 2012 +0200
@@ -172,7 +172,8 @@
 	$(CLASSES)/$(TESTSUITE_DIR)/ClippingPathByConvexPolygonalShape.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/ClippingPathByConcavePolygonalShape.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/ClippingPathBySelfIntersectingPolygonalShape.class \
-	$(CLASSES)/$(TESTSUITE_DIR)/ClippingPathByRoundRectangleShape.class
+	$(CLASSES)/$(TESTSUITE_DIR)/ClippingPathByRoundRectangleShape.class \
+	$(CLASSES)/$(TESTSUITE_DIR)/PrintTestBasic.class
 
 COMPARE_RESULTS = \
 	$(RESULTS)/Areas \
@@ -243,7 +244,8 @@
 	$(RESULTS)/ClippingPathByConcavePolygonalShape \
 	$(RESULTS)/ClippingPathBySelfIntersectingPolygonalShape \
 	$(RESULTS)/ClippingPathByRoundRectangleShape \
-	$(RESULTS)/ClippingPathByRectangleShape
+	$(RESULTS)/ClippingPathByRectangleShape \
+	$(RESULTS)/PrintTestBasic
 
 # targets for all test suites
 TESTSUITES = $(shell ls -1 src/org/gfxtest/testsuites | sed -n -e 's/\([A-Za-z0-9]*\)\.java/\1/p')
diff -r cba2ae48526e -r 31509443dff8 src/org/gfxtest/testsuites/PrintTestBasic.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/testsuites/PrintTestBasic.java	Mon Apr 16 11:27:52 2012 +0200
@@ -0,0 +1,107 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2010, 2011, 2012  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package org.gfxtest.testsuites;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.GfxTest;
+import org.gfxtest.framework.TestImage;
+import org.gfxtest.framework.TestResult;
+import org.gfxtest.framework.annotations.GraphicsPrimitive;
+import org.gfxtest.framework.annotations.GraphicsPrimitives;
+import org.gfxtest.framework.annotations.RenderStyle;
+import org.gfxtest.framework.annotations.RenderStyles;
+import org.gfxtest.framework.annotations.TestType;
+import org.gfxtest.framework.annotations.TestTypes;
+import org.gfxtest.framework.annotations.Transformation;
+import org.gfxtest.framework.annotations.Transformations;
+import org.gfxtest.framework.annotations.Zoom;
+
+
+
+/**
+ * This test suite checks basic functionality of built-in printing support.
+ * 
+ * @author Pavel Tisnovsky
+ */
+ at TestType(TestTypes.PRINT_TEST)
+ at GraphicsPrimitive(GraphicsPrimitives.LINE)
+ at RenderStyle(RenderStyles.NORMAL)
+ at Transformation(Transformations.NONE)
+ at Zoom(1)
+public class PrintTestBasic extends GfxTest
+{
+
+    /**
+     * Test basic behavior of method Graphics.drawLine().
+     *
+     * @param image
+     *            image to which line is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testDrawLine(TestImage image, Graphics2D graphics)
+    {
+        // set drawing color
+        graphics.setColor(Color.BLACK);
+
+        // draw two diagonals along the whole test image
+        graphics.drawLine(0, 0, image.getWidth(), image.getHeight());
+        graphics.drawLine(0, image.getHeight(), image.getWidth(), 0);
+
+        // test return value
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Entry point to the test suite.
+     *
+     * @param args not used in this case
+     */
+    public static void main(String[] args)
+    {
+        new PrintTestBasic().runTestSuite(args);
+    }
+}



More information about the distro-pkg-dev mailing list