ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Stockall <je...@cryptocard.com>
Subject Re: junit and log4j
Date Tue, 25 Feb 2003 12:18:05 GMT

On Tuesday, February 25, 2003, at 06:46 AM, Thomas Saxtoft wrote:

> I have a problem doing my test when using log4j. The tests can't find
> the log4j.properties. Where should I place the property file, and 
> should
> it be in my junit task?

You can specify the location with 
'-Dlog4j.configuration=/path/to/log4j.properties' So your ant target 
could contain this:

<junit
     printsummary="yes"
     fork="yes"
     showoutput="yes"
     dir="${classes.dir}">
     <formatter type="xml" />
     <sysproperty key="log4j.configuration"  
value="/path/to/log4j.properties"/>

<!-- snip -->

</junit>

Or you can copy it to the classpath

See the "Default Initialization Procedure" section at 
http://jakarta.apache.org/log4j/docs/manual.html for more info.

Jesse Stockall - jesse@cryptocard.com
CRYPTOCard Corp.


Mime
View raw message