vmassol 01/06/17 06:41:07
Modified: cactus/src/framework/share/org/apache/commons/cactus
AbstractTestCase.java
Log:
added logging using log4j
Revision Changes Path
1.2 +15 -0
jakarta-commons/cactus/src/framework/share/org/apache/commons/cactus/AbstractTestCase.java
Index: AbstractTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/cactus/src/framework/share/org/apache/commons/cactus/AbstractTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTestCase.java 2001/04/19 23:22:10 1.1
+++ AbstractTestCase.java 2001/06/17 13:41:07 1.2
@@ -62,6 +62,7 @@
import org.apache.commons.cactus.client.*;
import org.apache.commons.cactus.server.*;
+import org.apache.commons.cactus.util.log.*;
/**
* Abstract class that specific test cases (<code>ServletTestCase</code>,
@@ -97,6 +98,11 @@
public String currentTestMethod;
/**
+ * The logger (only used on the client side).
+ */
+ protected static Log logger;
+
+ /**
* Constructs a JUnit test case with the given name.
*
* @param theName the name of the test case
@@ -263,6 +269,15 @@
*/
public void runBare() throws Throwable
{
+ // Initialize the client side logging system if need be. The code is
+ // place here because although this class is instanciated on both the
+ // the server side and the client side, this method is only executed
+ // on the client side.
+ if (!LogService.getInstance().isInitialized()) {
+ LogService.getInstance().init("/log_client.properties");
+ logger = LogService.getInstance().getLog(this.getClass().getName());
+ }
+
runTest();
}