blob: 447e0fab6dca4795152f7fc0474cc5bc2a3b59e9 [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 $* org.apache.log4j.test.DefaultInit > $TEMP
check witness/propCfg.$TEST $TEMP; echo "OK."
}
# ==================================================
declare -i TEST
LCF=log4j.properties
function createProperties {
echo "" > $LCF
lecho "log4j.rootLogger=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
#org.apache.log4j.test.SysoutConfigurator
TEST=2
if [ $TEST -ge $start ]; then
testPropConfig -Dlog4j=debug -Dlog4j.configuration=file:$LCF -Dlog4j.configuratorClass=org.apache.log4j.test.SysoutConfigurator
fi
rm $LCF