[logback-dev] svn commit: r1086 - in logback/trunk/log4j-bridge/compatibility: . lib src src/main src/main/java src/main/java/test target

noreply.seb at qos.ch noreply.seb at qos.ch
Fri Dec 15 14:12:39 CET 2006


Author: seb
Date: Fri Dec 15 14:12:39 2006
New Revision: 1086

Added:
   logback/trunk/log4j-bridge/compatibility/
   logback/trunk/log4j-bridge/compatibility/build.xml
   logback/trunk/log4j-bridge/compatibility/lib/
   logback/trunk/log4j-bridge/compatibility/lib/junit-3.8.1.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/log4j-1.2.14.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/log4j-1.3alpha-8.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/log4j-bridge-0.7-SNAPSHOT.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/logback-classic-0.7-SNAPSHOT.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/logback-core-0.7-SNAPSHOT.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/lib/slf4j-api-1.1.0-RC1.jar   (contents, props changed)
   logback/trunk/log4j-bridge/compatibility/src/
   logback/trunk/log4j-bridge/compatibility/src/main/
   logback/trunk/log4j-bridge/compatibility/src/main/java/
   logback/trunk/log4j-bridge/compatibility/src/main/java/test/
   logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j12Calls.java
   logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j13Calls.java
   logback/trunk/log4j-bridge/compatibility/target/   (props changed)

Log:
Added the log4j compatibility test in the log4j-bridge module

Added: logback/trunk/log4j-bridge/compatibility/build.xml
==============================================================================
--- (empty file)
+++ logback/trunk/log4j-bridge/compatibility/build.xml	Fri Dec 15 14:12:39 2006
@@ -0,0 +1,100 @@
+<project name="testing-log4j-bridge" default="usage" basedir=".">
+
+	<property name="source.home" value="./src/main/java/" />
+	<property name="javac.dest.12" value="./target/classes12/" />
+	<property name="javac.dest.13" value="./target/classes13/" />
+	<property name="lib" value="./lib" />
+
+	<property name="version" value="1.0" />
+	<property name="deprecation" value="on" />
+
+	<path id="basic.classpath">
+		<pathelement location="${source.home}" />
+		<pathelement location="${lib}/junit-3.8.1.jar" />
+	</path>
+
+	<path id="log4j12.classpath">
+		<path refid="basic.classpath" />
+		<pathelement location="${javac.dest.12}" />
+		<pathelement location="${lib}/log4j-1.2.14.jar" />
+	</path>
+
+	<path id="log4j13.classpath">
+		<path refid="basic.classpath" />
+		<pathelement location="${javac.dest.13}" />
+		<pathelement location="${lib}/log4j-1.3alpha-8.jar" />
+	</path>
+
+	<path id="log4-bridge.classpath">
+		<path refid="basic.classpath" />
+		<pathelement location="${lib}/log4j-bridge-0.7-SNAPSHOT.jar" />
+		<pathelement location="${lib}/logback-classic-0.7-SNAPSHOT.jar" />
+		<pathelement location="${lib}/logback-core-0.7-SNAPSHOT.jar" />
+		<pathelement location="${lib}/slf4j-api-1.1.0-RC1.jar" />
+	</path>
+
+	<!-- ================================================================= -->
+	<!-- Default target                                                    -->
+	<!-- ================================================================= -->
+	<target name="usage">
+		<echo>      
+      These are some of the targets supported by this ANT build scpript:
+
+      all - run all available tests
+      
+    </echo>
+	</target>
+
+	<target name="init">
+		<mkdir dir="${javac.dest.12}" />
+		<mkdir dir="${javac.dest.13}" />
+	</target>
+
+	<target name="clean">
+		<delete>
+			<fileset dir="${javac.dest.12}" includes="**" />
+			<fileset dir="${javac.dest.13}" includes="**" />
+		</delete>
+	</target>
+
+	<target name="build_log4j12" depends="init">
+		<javac srcdir="${source.home}" 
+			     destdir="${javac.dest.12}" 
+			     includes="**/Log4j12Calls.java" 
+			      deprecation="${deprecation}" debug="on">
+			<classpath refid="log4j12.classpath" />
+		</javac>
+	</target>
+
+	<target name="build_log4j13" depends="init">
+		<javac srcdir="${source.home}" 
+			     destdir="${javac.dest.13}" 
+			     includes="**/Log4j13Calls.java" deprecation="${deprecation}" debug="on">
+			<classpath refid="log4j13.classpath" />
+		</javac>
+	</target>
+
+	<!-- ================================================================= -->
+	<!-- Run tests                                                     -->
+	<!-- ================================================================= -->
+	<target name="all" depends="test1, test2" />
+
+	<target name="test1" depends="build_log4j12">
+		<junit printsummary="yes" fork="yes" haltonfailure="yes">
+			<classpath refid="log4-bridge.classpath" />
+			<classpath location="${javac.dest.12}" />
+			<formatter type="plain" usefile="false" />
+			<test name="test.Log4j12Calls" />
+		</junit>
+	</target>
+
+	<target name="test2" depends="build_log4j13">
+		<junit printsummary="yes" fork="yes" haltonfailure="yes">
+			<classpath refid="log4-bridge.classpath" />
+			<classpath location="${javac.dest.13}" />
+			<formatter type="plain" usefile="false" />
+			<test name="test.Log4j13Calls" />
+		</junit>
+	</target>
+
+</project>

Added: logback/trunk/log4j-bridge/compatibility/lib/junit-3.8.1.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/log4j-1.2.14.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/log4j-1.3alpha-8.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/log4j-bridge-0.7-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/logback-classic-0.7-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/logback-core-0.7-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/lib/slf4j-api-1.1.0-RC1.jar
==============================================================================
Binary file. No diff available.

Added: logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j12Calls.java
==============================================================================
--- (empty file)
+++ logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j12Calls.java	Fri Dec 15 14:12:39 2006
@@ -0,0 +1,22 @@
+package test;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.MDC;
+
+public class Log4j12Calls extends TestCase {
+  public static final Logger logger = Logger.getLogger(Log4j12Calls.class);
+  
+  public void testLog() {
+    MDC.put("key", "value1");
+    
+    logger.debug("Entering application");
+    logger.info("Violets are blue");
+    logger.warn("Here is a warning");
+    
+    logger.error("Exiting application", new Exception("just testing"));
+    
+    MDC.remove("key");
+  }
+}

Added: logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j13Calls.java
==============================================================================
--- (empty file)
+++ logback/trunk/log4j-bridge/compatibility/src/main/java/test/Log4j13Calls.java	Fri Dec 15 14:12:39 2006
@@ -0,0 +1,26 @@
+package test;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.MDC;
+
+public class Log4j13Calls extends TestCase {
+  public static final Logger logger = Logger.getLogger(Log4j12Calls.class);
+  
+  public void testLog() {
+    MDC.put("key", "value1");
+    
+    logger.debug("Entering application");
+    logger.info("Violets are blue");
+    logger.warn("Here is a warning");
+    logger.info("The answer is {}.", new Integer(42));
+    logger.info("Number: {} and another one: {}.", new Integer(42), new Integer(24));
+    
+    logger.error("Exiting application", new Exception("just testing"));
+    
+    MDC.remove("key");
+    
+    MDC.clear();
+  }
+}



More information about the logback-dev mailing list