Author: grobmeier
Date: Thu Aug 27 21:19:50 2009
New Revision: 808635
URL: http://svn.apache.org/viewvc?rev=808635&view=rev
Log:
added threshold tests to property configurator
Added:
incubator/log4php/trunk/src/test/php/configurators/test4.properties
Modified:
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
Modified:
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php?rev=808635&r1=808634&r2=808635&view=diff
==============================================================================
---
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
(original)
+++
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
Thu Aug 27 21:19:50 2009
@@ -85,4 +85,28 @@
}
self::assertNotNull($catchedException);
}
+
+ public function testThreshold() {
+ Logger::configure('configurators/test4.properties');
+ $root = Logger::getRootLogger();
+ self::assertEquals(LoggerLevel::getLevelWarn(),
$root->getLevel());
+ $appender = $root->getAppender("default");
+ self::assertTrue($appender instanceof LoggerAppenderEcho);
+ $layout = $appender->getLayout();
+ self::assertTrue($layout instanceof LoggerLayoutSimple);
+ $threshold = $appender->getThreshold();
+ self::assertTrue($threshold instanceof LoggerLevel);
+ $e = LoggerLevel::getLevelWarn();
+ self::assertEquals($e,$threshold);
+
+ $appender = $root->getAppender("blub");
+ self::assertTrue($appender instanceof LoggerAppenderEcho);
+ $layout = $appender->getLayout();
+ self::assertTrue($layout instanceof LoggerLayoutSimple);
+ $threshold = $appender->getThreshold();
+ self::assertTrue($threshold instanceof LoggerLevel);
+ $e = LoggerLevel::getLevelInfo();
+ self::assertEquals($e,$threshold);
+
+ }
}
Added: incubator/log4php/trunk/src/test/php/configurators/test4.properties
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/configurators/test4.properties?rev=808635&view=auto
==============================================================================
--- incubator/log4php/trunk/src/test/php/configurators/test4.properties (added)
+++ incubator/log4php/trunk/src/test/php/configurators/test4.properties Thu Aug
27 21:19:50 2009
@@ -0,0 +1,24 @@
+; Licensed to the Apache Software Foundation (ASF) under one or more
+; contributor license agreements. See the NOTICE file distributed with
+; this work for additional information regarding copyright ownership.
+; The ASF licenses this file to You under the Apache License, Version 2.0
+; (the "License"); you may not use this file except in compliance with
+; the License. You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+;
+log4php.appender.default = LoggerAppenderEcho
+log4php.appender.default.layout = LoggerLayoutSimple
+log4php.appender.default.threshold = WARN
+
+log4php.appender.blub = LoggerAppenderEcho
+log4php.appender.blub.layout = LoggerLayoutSimple
+log4php.appender.blub.threshold = INFO
+
+log4php.rootCategory = WARN, default, blub