[Schmitzm-commits] r1372 - trunk/src_junit/schmitzm/junit

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 18 00:11:17 CET 2011


Author: alfonx
Date: 2011-01-18 00:11:17 +0100 (Tue, 18 Jan 2011)
New Revision: 1372

Modified:
   trunk/src_junit/schmitzm/junit/TestingClass.java
Log:


Modified: trunk/src_junit/schmitzm/junit/TestingClass.java
===================================================================
--- trunk/src_junit/schmitzm/junit/TestingClass.java	2011-01-17 16:21:05 UTC (rev 1371)
+++ trunk/src_junit/schmitzm/junit/TestingClass.java	2011-01-17 23:11:17 UTC (rev 1372)
@@ -6,19 +6,30 @@
 import schmitzm.swing.TestingUtil;
 
 /**
- * Abstract super class for our test classes to initialize some
- * general stuff, e.g. logger.
+ * Abstract super class for our test classes to initialize some general stuff,
+ * e.g. logger.
+ * 
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
  */
 public abstract class TestingClass {
-  // instantiate TestingUtil to initialize the Log4J appender 
-  static {
-    new TestingUtil();
-   }
-  
-  /** Logger for our testing classes. */
-  protected Logger log = LangUtil.createLogger(this);
+	// instantiate TestingUtil to initialize the Log4J appender
+	static {
+		new TestingUtil();
+	}
 
+	/** Logger for our testing classes. */
+	protected Logger log = LangUtil.createLogger(this);
 
+	/**
+	 * @return Description of current memory status (e.g. "12/64MB free")
+	 */
+	protected final static String getMemoryInfo() {
+		Runtime rt = Runtime.getRuntime();
+		long max = rt.maxMemory();
+		long free = rt.freeMemory();
+		long total = rt.totalMemory();
+		return ((max - total + free) / 1024 / 1024) + "/" + (max / 1024 / 1024)
+				+ "Mb free";
+	}
 
 }



More information about the Schmitzm-commits mailing list