You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rs...@apache.org on 2002/10/19 19:14:26 UTC
cvs commit: jakarta-commons/logging/src/test/org/apache/commons/logging LogTest.java AbstractLogTest.java TestAll.java
rsitze 2002/10/19 10:14:26
Modified: logging/src/test/org/apache/commons/logging
AbstractLogTest.java TestAll.java
Added: logging/src/test/org/apache/commons/logging LogTest.java
Log:
- Added new LogTest that exercises factory
- log statements now show implementation class
(helpfull for visual verification that expected logger was found).
Revision Changes Path
1.5 +18 -13 jakarta-commons/logging/src/test/org/apache/commons/logging/AbstractLogTest.java
Index: AbstractLogTest.java
===================================================================
RCS file: /home/cvs/jakarta-commons/logging/src/test/org/apache/commons/logging/AbstractLogTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractLogTest.java 18 Oct 2002 04:19:56 -0000 1.4
+++ AbstractLogTest.java 19 Oct 2002 17:14:26 -0000 1.5
@@ -86,53 +86,58 @@
assertNotNull(log);
+
log.debug(null);
log.debug(null, null);
- log.debug("debug statement");
+ log.debug(log.getClass().getName() + ": debug statement");
- log.debug("debug statement w/ null exception", new RuntimeException());
+ log.debug(log.getClass().getName() + ": debug statement w/ null exception", new RuntimeException());
+
log.error(null);
log.error(null, null);
- log.error("error statement");
+ log.error(log.getClass().getName() + ": error statement");
- log.error("error statement w/ null exception", new RuntimeException());
+ log.error(log.getClass().getName() + ": error statement w/ null exception", new RuntimeException());
+
log.fatal(null);
log.fatal(null, null);
- log.fatal("fatal statement");
+ log.fatal(log.getClass().getName() + ": fatal statement");
- log.fatal("fatal statement w/ null exception", new RuntimeException());
+ log.fatal(log.getClass().getName() + ": fatal statement w/ null exception", new RuntimeException());
+
log.info(null);
log.info(null, null);
- log.info("info statement");
+ log.info(log.getClass().getName() + ": info statement");
- log.info("info statement w/ null exception", new RuntimeException());
+ log.info(log.getClass().getName() + ": info statement w/ null exception", new RuntimeException());
+
log.trace(null);
log.trace(null, null);
- log.trace("trace statement");
+ log.trace(log.getClass().getName() + ": trace statement");
+
+ log.trace(log.getClass().getName() + ": trace statement w/ null exception", new RuntimeException());
- log.trace("trace statement w/ null exception", new RuntimeException());
log.warn(null);
log.warn(null, null);
- log.warn("warn statement");
-
- log.warn("warn statement w/ null exception", new RuntimeException());
+ log.warn(log.getClass().getName() + ": warn statement");
+ log.warn(log.getClass().getName() + ": warn statement w/ null exception", new RuntimeException());
}
}
1.4 +5 -4 jakarta-commons/logging/src/test/org/apache/commons/logging/TestAll.java
Index: TestAll.java
===================================================================
RCS file: /home/cvs/jakarta-commons/logging/src/test/org/apache/commons/logging/TestAll.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestAll.java 11 Oct 2002 04:53:21 -0000 1.3
+++ TestAll.java 19 Oct 2002 17:14:26 -0000 1.4
@@ -88,6 +88,7 @@
suite.addTest(SimpleLogTest.suite());
suite.addTest(NoOpLogTest.suite());
+ suite.addTest(LogTest.suite());
return suite;
}
1.1 jakarta-commons/logging/src/test/org/apache/commons/logging/LogTest.java
Index: LogTest.java
===================================================================
package org.apache.commons.logging;
import org.apache.commons.logging.impl.SimpleLog;
import junit.framework.*;
/**
*
*
*
*
*
*
*/
public class LogTest extends AbstractLogTest
{
/**
*
*
* @param testName
*
*/
public LogTest(String testName)
{
super(testName);
}
/**
*
*
*
*/
public Log getLogObject()
{
/**
* Pickup whatever is found/configured!
*/
return LogFactory.getLog(this.getClass().getName());
}
public static void main(String[] args)
{
String[] testCaseName = { LogTest.class.getName() };
junit.textui.TestRunner.main(testCaseName);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(LogTest.class);
return suite;
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>