[slf4j-dev] svn commit: r208 - in slf4j/trunk/tests: . src/java/org/apache/commons/logging

ceki at slf4j.org ceki at slf4j.org
Fri Aug 26 22:53:15 CEST 2005


Author: ceki
Date: Fri Aug 26 22:53:14 2005
New Revision: 208

Added:
   slf4j/trunk/tests/src/java/org/apache/commons/logging/InvokeJCLWithNOPTest.java
Removed:
   slf4j/trunk/tests/src/java/org/apache/commons/logging/BasicJCLTest.java
Modified:
   slf4j/trunk/tests/build.xml
Log:
added JCL invocation tests (under slf4j-simple and slf4j-nop)

Modified: slf4j/trunk/tests/build.xml
==============================================================================
--- slf4j/trunk/tests/build.xml	(original)
+++ slf4j/trunk/tests/build.xml	Fri Aug 26 22:53:14 2005
@@ -27,6 +27,16 @@
     <pathelement location="../slf4j-simple.jar"/>
   </path>
 
+  <path id="jcl.classpath">
+    <path refid="simple.classpath"/>
+    <fileset dir="../"><include name="jcl-over-slf4j*.jar"/></fileset>
+  </path>
+
+  <path id="jcl-nop.classpath">
+    <path refid="nop.classpath"/>
+    <fileset dir="../"><include name="jcl-over-slf4j*.jar"/></fileset>
+  </path>
+	   	  	
   <path id="jdk14.classpath">
     <path refid="basic.classpath"/>
     <pathelement location="../slf4j-jdk14.jar"/>
@@ -34,9 +44,7 @@
 
    <path id="nlog4j12x.classpath">
      <path refid="basic.classpath"/>
-     <fileset dir="./lib/">
-       <include name="nlog4j*.jar"/>
-     </fileset>
+     <fileset dir="./lib/"><include name="nlog4j*.jar"/></fileset>
   </path>
 
 
@@ -107,7 +115,8 @@
                                      InvokeNOP,
                                      InvokeSimple,
                                      InvokeJDK14,
-                                     InvokeNLOG4J12x"
+                                     InvokeNLOG4J12x,
+  	                                 InvokeJCL"
                                      />
 
   <target name="MessageFormatter" depends="build, cleanOutputDir">
@@ -156,11 +165,27 @@
   </target>
 
   <target name="XLoggerBySystemProps" depends="build, slf4j-simple.jar, cleanOutputDir">
-	    <junit printsummary="yes" fork="yes" haltonfailure="yes">
-	      <classpath refid="simple.classpath"/>
-	      <formatter type="plain" usefile="false"/>
-	      <test name="org.slf4j.XLoggerBySystemPropsTest" />
-	    </junit>
-	  </target>
+    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+      <classpath refid="simple.classpath"/>
+      <formatter type="plain" usefile="false"/>
+      <test name="org.slf4j.XLoggerBySystemPropsTest" />
+    </junit>
+  </target>
 
+  <target name="InvokeJCL" depends="build, slf4j-simple.jar, cleanOutputDir">
+    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+      <classpath refid="jcl.classpath"/>
+      <formatter type="plain" usefile="false"/>
+      <test name="org.apache.commons.logging.InvokeJCLTest" />
+    </junit>
+  </target>
+	
+  <target name="InvokeJCLWithNOP" depends="build, slf4j-simple.jar, cleanOutputDir">
+    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+      <classpath refid="jcl-nop.classpath"/>
+      <formatter type="plain" usefile="false"/>
+      <test name="org.apache.commons.logging.InvokeJCLWithNOPTest" />
+    </junit>
+  </target>
+  
 </project>

Added: slf4j/trunk/tests/src/java/org/apache/commons/logging/InvokeJCLWithNOPTest.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/tests/src/java/org/apache/commons/logging/InvokeJCLWithNOPTest.java	Fri Aug 26 22:53:14 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2004-2005 SLF4J.ORG
+ * Copyright (c) 2004-2005 QOS.ch
+ *
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to  deal in  the Software without  restriction, including
+ * without limitation  the rights to  use, copy, modify,  merge, publish,
+ * distribute, and/or sell copies of  the Software, and to permit persons
+ * to whom  the Software is furnished  to do so, provided  that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the  Software and  that both  the above  copyright notice(s)  and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+ * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR  A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF  THIRD PARTY  RIGHTS. IN  NO EVENT  SHALL THE  COPYRIGHT  HOLDER OR
+ * HOLDERS  INCLUDED IN  THIS  NOTICE BE  LIABLE  FOR ANY  CLAIM, OR  ANY
+ * SPECIAL INDIRECT  OR CONSEQUENTIAL DAMAGES, OR  ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS  OF USE, DATA OR PROFITS, WHETHER  IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE  OR OTHER TORTIOUS  ACTION, ARISING OUT OF  OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as  contained in  this notice, the  name of a  copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+
+package org.apache.commons.logging;
+
+import junit.framework.TestCase;
+
+
+public class InvokeJCLWithNOPTest extends TestCase {
+
+  public void testIsEnabledAPI() {
+    // assume that we are running over slf4j-nop
+    Log log = LogFactory.getLog(InvokeJCLWithNOPTest.class);
+    assertFalse(log.isTraceEnabled());
+    assertFalse(log.isDebugEnabled());
+    assertFalse(log.isInfoEnabled());
+    assertFalse(log.isWarnEnabled());
+    assertFalse(log.isErrorEnabled());
+    assertFalse(log.isFatalEnabled());
+  }
+  
+  public void testPrintAPI() {
+    Log log = LogFactory.getLog(InvokeJCLWithNOPTest.class);
+    Exception e = new Exception("just testing");
+    log.trace("trace message");
+    log.debug("debug message");
+    log.info("info  message");
+    log.warn("warn message");
+    log.error("error message");
+    log.fatal("fatal message");
+    
+    log.trace("trace message", e);
+    log.debug("debug message", e);
+    log.info("info  message", e);
+    log.warn("warn message", e);
+    log.error("error message", e);
+    log.fatal("fatal message", e);
+  }
+}



More information about the slf4j-dev mailing list