[Schmitzm-commits] r1210 - in trunk/src_junit/schmitzm: . jfree/feature/style junit swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 3 02:25:16 CET 2010


Author: mojays
Date: 2010-11-03 02:25:15 +0100 (Wed, 03 Nov 2010)
New Revision: 1210

Added:
   trunk/src_junit/schmitzm/junit/
   trunk/src_junit/schmitzm/junit/TestingClass.java
Modified:
   trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java
   trunk/src_junit/schmitzm/swing/TestingUtil.java
Log:
New TestingClass as super class for our tests (e.g. to initialize logger and appender)

Modified: trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java
===================================================================
--- trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java	2010-11-03 00:35:36 UTC (rev 1209)
+++ trunk/src_junit/schmitzm/jfree/feature/style/FeatureChartStyleTest.java	2010-11-03 01:25:15 UTC (rev 1210)
@@ -51,12 +51,11 @@
 import schmitzm.jfree.chart.style.ChartType;
 import schmitzm.jfree.data.RegressionDataset;
 import schmitzm.jfree.table.AggregationFunction;
+import schmitzm.junit.TestingClass;
 import schmitzm.swing.SwingUtil;
 import schmitzm.swing.TestingUtil;
 
-public class FeatureChartStyleTest {
-	private static Logger log = Logger.getLogger(FeatureChartStyleTest.class);
-
+public class FeatureChartStyleTest extends TestingClass {
 	FeatureChartStyleXMLFactory xmlFactoryFeature = new FeatureChartStyleXMLFactory();
 	ChartStyleXMLFactory<ChartStyle> xmlFactoryBasic = new ChartStyleXMLFactory<ChartStyle>();
 

Added: trunk/src_junit/schmitzm/junit/TestingClass.java
===================================================================
--- trunk/src_junit/schmitzm/junit/TestingClass.java	2010-11-03 00:35:36 UTC (rev 1209)
+++ trunk/src_junit/schmitzm/junit/TestingClass.java	2010-11-03 01:25:15 UTC (rev 1210)
@@ -0,0 +1,25 @@
+package schmitzm.junit;
+
+import org.apache.log4j.Logger;
+
+import schmitzm.jfree.feature.style.FeatureChartStyleTest;
+import schmitzm.lang.LangUtil;
+import schmitzm.swing.TestingUtil;
+
+/**
+ * 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);
+
+
+
+}

Modified: trunk/src_junit/schmitzm/swing/TestingUtil.java
===================================================================
--- trunk/src_junit/schmitzm/swing/TestingUtil.java	2010-11-03 00:35:36 UTC (rev 1209)
+++ trunk/src_junit/schmitzm/swing/TestingUtil.java	2010-11-03 01:25:15 UTC (rev 1210)
@@ -31,6 +31,7 @@
 import org.apache.log4j.ConsoleAppender;
 import org.apache.log4j.Layout;
 import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
 import org.apache.log4j.SimpleLayout;
 import org.geotools.data.DataStore;
 import org.geotools.data.DataUtilities;
@@ -60,7 +61,7 @@
 public class TestingUtil {
 	
 	static {
-		Logger.getRootLogger().addAppender(new ConsoleAppender(new SimpleLayout(),"System.out"));
+		Logger.getRootLogger().addAppender(new ConsoleAppender(new PatternLayout("%r\t%p\t%c\t%m%n"),"System.out"));
 	}
 
 	/**



More information about the Schmitzm-commits mailing list