[Schmitzm-commits] r1493 - trunk/schmitzm-core/src/test/java/de/schmitzm/testing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 7 22:00:09 CET 2011


Author: alfonx
Date: 2011-02-07 22:00:09 +0100 (Mon, 07 Feb 2011)
New Revision: 1493

Modified:
   trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingClass.java
   trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java
Log:
Stopping the InteractiveTests

Modified: trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingClass.java
===================================================================
--- trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingClass.java	2011-02-05 14:00:13 UTC (rev 1492)
+++ trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingClass.java	2011-02-07 21:00:09 UTC (rev 1493)
@@ -19,6 +19,10 @@
 	 *         Windows or X11).
 	 */
 	public boolean isInteractive() {
+		return hasGui();
+	}
+
+	public boolean hasGui() {
 		return TestingUtil.INTERACTIVE;
 	}
 

Modified: trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java
===================================================================
--- trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java	2011-02-05 14:00:13 UTC (rev 1492)
+++ trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java	2011-02-07 21:00:09 UTC (rev 1493)
@@ -30,7 +30,6 @@
 import de.schmitzm.lang.LangUtil;
 import de.schmitzm.swing.ExceptionDialog;
 
-
 /**
  * Helpers to test Swing applications in general. <br/>
  * If not set to @Ignore, HUDSON will complain
@@ -44,12 +43,19 @@
 	}
 
 	/**
-	 * All these GUI-initiating testGui(...) methods are only executed if the
-	 * system is not running in headless mode.
+	 * @deprecated
+	 * @see #HASGUI
 	 */
+	@Deprecated
 	public static final boolean INTERACTIVE = !GraphicsEnvironment.isHeadless();
 
 	/**
+	 * All GUI-initiating testGui(...) methods are only executed if the system
+	 * is not running in head-less mode.
+	 */
+	public static final boolean HASGUI = !GraphicsEnvironment.isHeadless();
+
+	/**
 	 * Number of seconds to wait until a GUI should be closed by default. Can be
 	 * set to -1 to always wait forever.
 	 */
@@ -101,7 +107,6 @@
 		return checkPixel(bi, x, y, expectedColor);
 	}
 
-
 	/**
 	 * Returns the percentage of the possible maximum head size used (0 to 100)
 	 */
@@ -127,10 +132,22 @@
 		return perc;
 	}
 
+	/**
+	 * @deprecated
+	 * @see #hasG
+	 */
+	@Deprecated
 	public static boolean isInteractive() {
 		return INTERACTIVE;
 	}
 
+	/**
+	 * If <code>false</code> using code that touches Toolkit will crash.
+	 */
+	public static boolean hasGui() {
+		return HASGUI;
+	}
+
 	public static void testGui(Component gui) throws Throwable {
 		testGui(gui, WAIT_MAX_DEFAULT);
 	}



More information about the Schmitzm-commits mailing list