Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 40233 invoked from network); 5 Sep 2005 20:48:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Sep 2005 20:48:19 -0000 Received: (qmail 61434 invoked by uid 500); 5 Sep 2005 20:48:19 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 61282 invoked by uid 500); 5 Sep 2005 20:48:18 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 61269 invoked by uid 500); 5 Sep 2005 20:48:18 -0000 Received: (qmail 61266 invoked by uid 99); 5 Sep 2005 20:48:18 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 05 Sep 2005 13:48:18 -0700 Received: (qmail 40230 invoked by uid 65534); 5 Sep 2005 20:48:18 -0000 Message-ID: <20050905204818.40229.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r278832 - /db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java Date: Mon, 05 Sep 2005 20:48:17 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tfischer Date: Mon Sep 5 13:48:15 2005 New Revision: 278832 URL: http://svn.apache.org/viewcvs?rev=278832&view=rev Log: initialize logging, correct path to the Torque.properties file Modified: db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java Modified: db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java?rev=278832&r1=278831&r2=278832&view=diff ============================================================================== --- db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java (original) +++ db/torque/test/trunk/maven-test-plugin/src/plugin-resources/java/org/apache/torque/BaseRuntimeTestCase.java Mon Sep 5 13:48:15 2005 @@ -18,6 +18,12 @@ import junit.framework.TestCase; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.impl.Log4JLogger; +import org.apache.commons.logging.impl.LogFactoryImpl; +import org.apache.log4j.PropertyConfigurator; + /** * Base functionality to be extended by all Torque test cases. Test * case implementations are used to automate unit testing via JUnit. @@ -27,12 +33,36 @@ */ public abstract class BaseRuntimeTestCase extends TestCase { - /** The path to the configuration file. */ + /** The path to the Torque configuration file. */ private static final String CONFIG_FILE - = "target/test/rttest/Torque.properties"; + = "target/tests/base/Torque.properties"; + + /** The path to the log4j configuration file. */ + private static final String LOG4J_CONFIG_FILE + = "target/tests/base/log4j.properties"; /** Whether torque has been initialized. */ static boolean hasInitialized = false; + + static + { + // initialize log4j + PropertyConfigurator.configure(LOG4J_CONFIG_FILE); + + // initialize commons-logging + // For whatever reasons, the default logger seems to be simplelog here. + // Only the loggers created after this configuration will be log4j + // loggers and write to the output file. + // Not the optimal solution, but better than nothing. + LogFactory.releaseAll(); + LogFactory factory = LogFactory.getFactory(); + factory.setAttribute( + LogFactoryImpl.LOG_PROPERTY, + Log4JLogger.class.getName()); + + Log log = LogFactory.getLog(BaseRuntimeTestCase.class); + log.debug("Initialized Logging"); + } /** * Creates a new instance. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org