Author: grobmeier
Date: Sun May 24 13:35:05 2009
New Revision: 778145

URL: http://svn.apache.org/viewvc?rev=778145&view=rev
Log:
more tests

Added:
    incubator/log4php/trunk/src/test/php/configurators/test2.properties
    incubator/log4php/trunk/src/test/php/configurators/test3.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=778145&r1=778144&r2=778145&view=diff
==============================================================================
--- 
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
 (original)
+++ 
incubator/log4php/trunk/src/test/php/configurators/LoggerConfiguratorIniTest.php
 Sun May 24 13:35:05 2009
@@ -43,4 +43,23 @@
                $layout = $appender->getLayout();
                self::assertTrue(is_a($layout, 'LoggerLayoutSimple'));
        }
+       
+       public function testConfigureWithRootCategory() {
+               
LoggerConfiguratorIni::configure('configurators/test3.properties');
+               $hierarchy = LoggerManager::getLoggerRepository();
+               $root = $hierarchy->getRootLogger();
+               self::assertEquals(LoggerLevel::getLevelWarn(), 
$root->getLevel());
+               $appender = $root->getAppender("default");
+               self::assertTrue(is_a($appender, 'LoggerAppenderEcho'));
+               $layout = $appender->getLayout();
+               self::assertTrue(is_a($layout, 'LoggerLayoutSimple'));
+       }
+       
+       public function testConfigureWithoutIniFile() {
+               self::assertFalse(LoggerConfiguratorIni::configure());
+       }
+       
+       public function testConfigureWithEmptyIniFile() {
+               
self::assertFalse(LoggerConfiguratorIni::configure('configurators/test2.properties'));
+       }
 }

Added: incubator/log4php/trunk/src/test/php/configurators/test2.properties
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/configurators/test2.properties?rev=778145&view=auto
==============================================================================
--- incubator/log4php/trunk/src/test/php/configurators/test2.properties (added)
+++ incubator/log4php/trunk/src/test/php/configurators/test2.properties Sun May 
24 13:35:05 2009
@@ -0,0 +1,16 @@
+; 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.
+;
+; EMPTY PROPERTIES
\ No newline at end of file

Added: incubator/log4php/trunk/src/test/php/configurators/test3.properties
URL: 
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/configurators/test3.properties?rev=778145&view=auto
==============================================================================
--- incubator/log4php/trunk/src/test/php/configurators/test3.properties (added)
+++ incubator/log4php/trunk/src/test/php/configurators/test3.properties Sun May 
24 13:35:05 2009
@@ -0,0 +1,18 @@
+; 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.rootCategory = WARN, default


Reply via email to