/hg/gfx-test: * src/org/gfxtest/framework/GfxTest.java:
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Mon Sep 10 01:24:30 PDT 2012
changeset da233eec72ee in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=da233eec72ee
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Sep 10 09:34:44 2012 +0200
* src/org/gfxtest/framework/GfxTest.java:
Make sure that file containing rendering result is closed.
* src/org/gfxtest/framework/ImageFactory.java:
Added check for proper image dimensions.
* src/org/gfxtest/framework/PrintJobWatcher.java:
Use notifyAll() instead of notify().
* src/org/gfxtest/framework/PrintingTest.java:
Added check that test got an instance of Graphics2D class.
* src/org/gfxtest/harness/MainWindow.java:
Removed unecessary test.
diffstat:
ChangeLog | 13 ++++
src/org/gfxtest/framework/GfxTest.java | 11 +++
src/org/gfxtest/framework/ImageFactory.java | 72 ++++++++++++++++++++++++++
src/org/gfxtest/framework/PrintJobWatcher.java | 2 +-
src/org/gfxtest/framework/PrintingTest.java | 7 ++
src/org/gfxtest/harness/MainWindow.java | 4 -
6 files changed, 104 insertions(+), 5 deletions(-)
diffs (249 lines):
diff -r bea796a9cf11 -r da233eec72ee ChangeLog
--- a/ChangeLog Fri Sep 07 10:19:46 2012 +0200
+++ b/ChangeLog Mon Sep 10 09:34:44 2012 +0200
@@ -1,3 +1,16 @@
+2012-09-10 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/GfxTest.java:
+ Make sure that file containing rendering result is closed.
+ * src/org/gfxtest/framework/ImageFactory.java:
+ Added check for proper image dimensions.
+ * src/org/gfxtest/framework/PrintJobWatcher.java:
+ Use notifyAll() instead of notify().
+ * src/org/gfxtest/framework/PrintingTest.java:
+ Added check that test got an instance of Graphics2D class.
+ * src/org/gfxtest/harness/MainWindow.java:
+ Removed unecessary test.
+
2012-09-07 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/framework/annotations/BitBltOperation.java:
diff -r bea796a9cf11 -r da233eec72ee src/org/gfxtest/framework/GfxTest.java
--- a/src/org/gfxtest/framework/GfxTest.java Fri Sep 07 10:19:46 2012 +0200
+++ b/src/org/gfxtest/framework/GfxTest.java Mon Sep 10 09:34:44 2012 +0200
@@ -574,12 +574,23 @@
}
finally
{
+ // really ugly implementation :(
try
{
// must be sure that output stream is really closed
// because we are going to use output file with
// converter
fileOutputStream.flush();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ try
+ {
+ // we must be sure that output stream is really closed
+ // because we are going to use output file with
+ // converter
fileOutputStream.close();
}
catch (IOException e)
diff -r bea796a9cf11 -r da233eec72ee src/org/gfxtest/framework/ImageFactory.java
--- a/src/org/gfxtest/framework/ImageFactory.java Fri Sep 07 10:19:46 2012 +0200
+++ b/src/org/gfxtest/framework/ImageFactory.java Mon Sep 10 09:34:44 2012 +0200
@@ -130,6 +130,12 @@
*/
public static BufferedImage createCheckerImage(int gridSize, int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// used by test for a tile colors
int doubledGridSize = gridSize << 1;
@@ -176,6 +182,12 @@
*/
public static BufferedImage createDiagonalCheckerImage(int gridSize, int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// used for computing checker texture
int width2 = width << 1;
@@ -222,6 +234,12 @@
*/
public static BufferedImage createGridImage(int gridSize, int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// used by test for a tile colors
int doubledGridSize = gridSize << 1;
@@ -266,6 +284,12 @@
*/
public static BufferedImage createDiagonalGridImage(int gridSize, int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// used by test for a tile colors
int doubledGridSize = gridSize << 1;
@@ -307,6 +331,12 @@
*/
public static BufferedImage createHorizontalStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -342,6 +372,12 @@
*/
public static BufferedImage createVerticalStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -378,6 +414,12 @@
*/
public static BufferedImage createDiagonalStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -413,6 +455,12 @@
*/
public static BufferedImage createHorizontalColorStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -446,6 +494,12 @@
*/
public static BufferedImage createVerticalColorStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -480,6 +534,12 @@
*/
public static BufferedImage createDiagonalColorStripesImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -514,6 +574,12 @@
*/
public static BufferedImage createBWDotsPatternImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
@@ -549,6 +615,12 @@
*/
public static BufferedImage createColorDotsPatternImage(int width, int height, int imageType)
{
+ // check for proper image dimensions
+ if (width <= 0 || height <= 0)
+ {
+ return null;
+ }
+
// create new image
BufferedImage image = new BufferedImage(width, height, imageType);
diff -r bea796a9cf11 -r da233eec72ee src/org/gfxtest/framework/PrintJobWatcher.java
--- a/src/org/gfxtest/framework/PrintJobWatcher.java Fri Sep 07 10:19:46 2012 +0200
+++ b/src/org/gfxtest/framework/PrintJobWatcher.java Mon Sep 10 09:34:44 2012 +0200
@@ -120,7 +120,7 @@
// set a flag
PrintJobWatcher.this.printJobDone = true;
// and notify PrintJobWatcher
- PrintJobWatcher.this.notify();
+ PrintJobWatcher.this.notifyAll();
}
}
});
diff -r bea796a9cf11 -r da233eec72ee src/org/gfxtest/framework/PrintingTest.java
--- a/src/org/gfxtest/framework/PrintingTest.java Fri Sep 07 10:19:46 2012 +0200
+++ b/src/org/gfxtest/framework/PrintingTest.java Mon Sep 10 09:34:44 2012 +0200
@@ -161,6 +161,13 @@
return NO_SUCH_PAGE;
}
+ // this should not usually happen, but make sure we
+ // got a proper instance of Graphics2D
+ if (!(graphics instanceof Graphics2D))
+ {
+ return 0;
+ }
+
Graphics2D gc = (Graphics2D)graphics;
translateCoordinateSystem(pageFormat, gc);
diff -r bea796a9cf11 -r da233eec72ee src/org/gfxtest/harness/MainWindow.java
--- a/src/org/gfxtest/harness/MainWindow.java Fri Sep 07 10:19:46 2012 +0200
+++ b/src/org/gfxtest/harness/MainWindow.java Mon Sep 10 09:34:44 2012 +0200
@@ -969,10 +969,6 @@
this.dialogs.showNoTestSelectedMessage();
}
String outputDirectory = Configuration.getTestClassesDirectory();
- if (outputDirectory == null)
- {
- this.dialogs.showErrorMessage("Output directory is not set");
- }
File fileToDelete = new File(outputDirectory, this.selectedTestSuite + ".class");
if (!fileToDelete.exists())
{
More information about the distro-pkg-dev
mailing list