blob: 9c126be4ef5c5e4f7430e3ea923ae34b1110d8ae [file] [log] [blame]
#!/bin/bash
# Read the .functions file
. .functions
# If set, allows to skip tests
declare -i start=$1
# ==================================================
function testPropConfig {
echo -n "PropertyConfiguratorInterface test $TEST - "
if [ -e $TEMP ]; then
#echo "Deleting $TEMP."
rm $TEMP
touch $TEMP
fi
java $1 org.apache.log4j.test.DefaultInit > $TEMP
check witness/propCfg.$TEST $TEMP; echo "OK."
}
# ==================================================
declare -i TEST
LCF=log4j.properties
function createProperties {
echo "" > $LCF
#if [ -n "$1" ]; then
# lecho "log4j.configurator=$1"
#fi
lecho "log4j.rootCategory=DEBUG, A1"
lecho "log4j.appender.A1=org.apache.log4j.FileAppender"
lecho "log4j.appender.A1.File=$TEMP"
lecho "log4j.appender.A1.Append=false"
lecho "log4j.appender.A1.layout=org.apache.log4j.PatternLayout "
lecho "log4j.appender.A1.layout.ConversionPattern=%m%n"
}
createProperties
TEST=1
if [ $TEST -ge $start ]; then
testPropConfig
fi
rm $LCF
createProperties org.apache.log4j.test.SysoutConfigurator
TEST=2
if [ $TEST -ge $start ]; then
testPropConfig -Dlog4j.configuration=file:///$LCF#org.apache.log4j.test.SysoutConfigurator
fi
rm $LCF