logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1203964 - in /logging/log4php/trunk/src: main/php/ main/php/configurators/ test/php/ test/php/configurators/ test/resources/ test/resources/configs/ test/resources/configs/adapters/ test/resources/configs/adapters/ini/ test/resources/confi...
Date Sat, 19 Nov 2011 10:32:34 GMT
Author: ihabunek
Date: Sat Nov 19 10:32:32 2011
New Revision: 1203964

URL: http://svn.apache.org/viewvc?rev=1203964&view=rev
Log:
LOG4PHP-152:
* Extensive new configurator and appender pool tests (contributed by Florian Semm)
* Improved parsing of renderers (contributed by Florian Semm)
* Improved error reporting when parsing XML files.

Added:
    logging/log4php/trunk/src/test/php/LoggerAppenderPoolTest.php
    logging/log4php/trunk/src/test/resources/
    logging/log4php/trunk/src/test/resources/configs/
    logging/log4php/trunk/src/test/resources/configs/adapters/
    logging/log4php/trunk/src/test/resources/configs/adapters/ini/
    logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_1.ini
    logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_2.ini
    logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_syntax.ini
    logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_valid.ini
    logging/log4php/trunk/src/test/resources/configs/adapters/php/
    logging/log4php/trunk/src/test/resources/configs/adapters/php/config_empty.php
    logging/log4php/trunk/src/test/resources/configs/adapters/php/config_invalid_syntax.php
    logging/log4php/trunk/src/test/resources/configs/adapters/php/config_not_an_array.php
    logging/log4php/trunk/src/test/resources/configs/adapters/php/config_valid.php
    logging/log4php/trunk/src/test/resources/configs/adapters/xml/
    logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_logger.xml
    logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_renderer.xml
    logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_invalid_syntax.xml
    logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_valid.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/
    logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_appender_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_parameters.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_layout_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_no_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_no_layout_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_filter_class.xml
    logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_layout_class.xml
    logging/log4php/trunk/src/test/resources/configs/config.yml
    logging/log4php/trunk/src/test/resources/configs/config1.xml
    logging/log4php/trunk/src/test/resources/configs/loggers/
    logging/log4php/trunk/src/test/resources/configs/loggers/config_invalid_additivity.xml
    logging/log4php/trunk/src/test/resources/configs/loggers/config_not_existing_appenders.xml
    logging/log4php/trunk/src/test/resources/configs/renderers/
    logging/log4php/trunk/src/test/resources/configs/renderers/config_invalid_rendering_class.xml
    logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendered_class.xml
    logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendering_class.xml
    logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendered_class.xml
    logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendering_class.xml
Removed:
    logging/log4php/trunk/src/test/php/configurators/config1.ini
    logging/log4php/trunk/src/test/php/configurators/config1.php
    logging/log4php/trunk/src/test/php/configurators/config1.xml
    logging/log4php/trunk/src/test/php/configurators/config2.ini
    logging/log4php/trunk/src/test/php/configurators/config2.php
    logging/log4php/trunk/src/test/php/configurators/config2.xml
    logging/log4php/trunk/src/test/php/configurators/config3.ini
    logging/log4php/trunk/src/test/php/configurators/config3.php
    logging/log4php/trunk/src/test/php/configurators/config3.xml
    logging/log4php/trunk/src/test/php/configurators/config4.ini
    logging/log4php/trunk/src/test/php/configurators/config4.php
    logging/log4php/trunk/src/test/php/configurators/config4.xml
Modified:
    logging/log4php/trunk/src/main/php/LoggerConfigurator.php
    logging/log4php/trunk/src/main/php/configurators/LoggerConfigurationAdapterXML.php
    logging/log4php/trunk/src/test/php/LoggerConfiguratorTest.php
    logging/log4php/trunk/src/test/php/bootstrap.php
    logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterINITest.php
    logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php
    logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterXMLTest.php

Modified: logging/log4php/trunk/src/main/php/LoggerConfigurator.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/LoggerConfigurator.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/LoggerConfigurator.php (original)
+++ logging/log4php/trunk/src/main/php/LoggerConfigurator.php Sat Nov 19 10:32:32 2011
@@ -218,12 +218,44 @@ class LoggerConfigurator
 
 		// Configure renderers
 		if (isset($config['renderers']) && is_array($config['renderers'])) {
-			foreach($config['renderers'] as $renderer) {
-				$hierarchy->getRendererMap()->addRenderer($renderer['renderedClass'], $renderer['renderingClass']);
+			foreach($config['renderers'] as $rendererConfig) {
+				$this->configureRenderer($hierarchy, $rendererConfig);
 			}
 		}
 	}
 	
+	private function configureRenderer(LoggerHierarchy $hierarchy, $config) {
+		if (!isset($config['renderingClass'])) {
+			$this->warn("Rendering class not specified. Skipping renderers definition.");
+			return;			
+		}
+		
+		$renderingClass = $config['renderingClass'];
+		if (!class_exists($renderingClass)) {
+			$this->warn("Nonexistant rendering class [$renderingClass] specified. Skipping renderers definition.");
+			return;
+		}
+		
+		$renderingClassInstance = new $renderingClass();
+		if (!$renderingClassInstance instanceof LoggerRendererObject) {
+			$this->warn("Invalid class [$renderingClass] given. Not a valid LoggerRenderer class. Skipping renderers definition.");
+			return;			
+		}
+	
+		if (!isset($config['renderedClass'])) {
+			$this->warn("Rendered class not specified for rendering Class [$renderingClass]. Skipping renderers definition.");
+			return;			
+		}
+		
+		$renderedClass = $config['renderedClass'];
+		if (!class_exists($renderedClass)) {
+			$this->warn("Nonexistant rendered class [$renderedClass] specified for renderer [$renderingClass]. Skipping renderers definition.");
+			return;
+		}		
+
+		$hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClassInstance);
+	}
+	
 	/** 
 	 * Configures an appender based on given config and saves it to 
 	 * {@link $appenders} array so it can be later linked to loggers. 

Modified: logging/log4php/trunk/src/main/php/configurators/LoggerConfigurationAdapterXML.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/configurators/LoggerConfigurationAdapterXML.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/configurators/LoggerConfigurationAdapterXML.php (original)
+++ logging/log4php/trunk/src/main/php/configurators/LoggerConfigurationAdapterXML.php Sat Nov 19 10:32:32 2011
@@ -74,12 +74,25 @@ class LoggerConfigurationAdapterXML impl
 		if (!file_exists($url)) {
 			throw new LoggerException("File [$url] does not exist.");
 		}
+
+		libxml_clear_errors();
+		$oldValue = libxml_use_internal_errors(true);
 		
 		// Load XML
-		$xml = simplexml_load_file($url);
+		$xml = @simplexml_load_file($url);
 		if ($xml === false) {
-			throw new LoggerException("Error loading confuguration file.");
+			
+			$errorStr = "";
+			foreach(libxml_get_errors() as $error) {
+				$errorStr .= $error->message;
+			}
+			
+			throw new LoggerException("Error loading configuration file: " . trim($errorStr));
 		}
+		
+		libxml_clear_errors();
+		libxml_use_internal_errors($oldValue);
+		
 		return $xml;
 	}
 	

Added: logging/log4php/trunk/src/test/php/LoggerAppenderPoolTest.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/LoggerAppenderPoolTest.php?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/php/LoggerAppenderPoolTest.php (added)
+++ logging/log4php/trunk/src/test/php/LoggerAppenderPoolTest.php Sat Nov 19 10:32:32 2011
@@ -0,0 +1,65 @@
+<?php
+/**
+ * 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.
+ * 
+ * @category   tests   
+ * @package    log4php
+ * @subpackage filters
+ * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
+ * @version    SVN: $Id$
+ * @link       http://logging.apache.org/log4php
+ */
+
+/**
+ * @group filters
+ */
+class LoggerAppenderPoolTest extends PHPUnit_Framework_TestCase {
+        
+	private $appenderMock;
+	
+	public function setUp() {
+		$this->appenderMock = $this->getMock('LoggerAppenderConsole', array(), array(), '', false);
+	}
+	
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage log4php: Cannot add unnamed appender to pool.
+ 	 */
+	public function testAppenderHasNoName() {
+		$this->appenderMock->expects($this->once())
+						   ->method('getName')
+						   ->will($this->returnValue(''));
+						   
+		LoggerAppenderPool::add($this->appenderMock);			
+	}
+	
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage log4php: Appender [foo] already exists in pool. Overwriting existing appender.
+ 	 */
+	public function testAppenderIsAdded() {
+		$this->appenderMock->expects($this->any())
+						   ->method('getName')
+						   ->will($this->returnValue('foo'));
+						   
+		LoggerAppenderPool::add($this->appenderMock);	
+		LoggerAppenderPool::add($this->appenderMock);	
+
+		$expected = 1;
+		$actual = count(LoggerAppenderPool::getAppenders());
+		$this->assertEquals($expected, $actual);
+	}	
+}

Modified: logging/log4php/trunk/src/test/php/LoggerConfiguratorTest.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/LoggerConfiguratorTest.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/test/php/LoggerConfiguratorTest.php (original)
+++ logging/log4php/trunk/src/test/php/LoggerConfiguratorTest.php Sat Nov 19 10:32:32 2011
@@ -47,6 +47,167 @@
  	}
  	
  	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid configuration param given. Reverting to default configuration.
+ 	 */
+ 	public function testInputIsInteger() {
+ 		Logger::configure(12345);
+ 	}
+ 	
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage log4php: Configuration failed. Unsupported configuration file extension: yml
+ 	 */ 	
+ 	public function testYAMLFile() {
+		Logger::configure(PHPUNIT_CONFIG_DIR . '/config.yml');
+ 	}
+
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid configuration provided for appender
+ 	 */
+ 	public function testAppenderConfigNotArray() {
+ 		$hierachyMock = $this->getMock('LoggerHierarchy', array(), array(), '', false);
+ 		
+ 		$config = array(
+	 		'appenders' => array(
+	            'default',
+	        ),
+        );
+
+        $configurator = new LoggerConfigurator();
+        $configurator->configure($hierachyMock, $config);
+ 	}
+ 	
+  	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage No class given for appender
+ 	 */
+ 	public function testNoAppenderClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_no_class.xml');
+ 	} 	
+ 	
+  	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid class [unknownClass] given for appender [foo]. Class does not exist. Skipping appender definition.
+ 	 */
+ 	public function testNotExistingAppenderClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_not_existing_class.xml');
+ 	} 
+
+   	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid class [stdClass] given for appender [foo]. Not a valid LoggerAppender class. Skipping appender definition.
+ 	 */
+ 	public function testInvalidAppenderClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_invalid_appender_class.xml');
+ 	} 	
+ 	
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistant filter class [Foo] specified on appender [foo]. Skipping filter definition.
+ 	 */
+ 	public function testNotExistingAppenderFilterClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_not_existing_filter_class.xml');
+ 	}
+
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistant option [fooParameter] specified on [LoggerFilterStringMatch]. Skipping.
+ 	 */
+ 	public function testInvalidAppenderFilterParamter() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_invalid_filter_parameters.xml');
+ 	} 	
+ 	
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid filter class [stdClass] sepcified on appender [foo]. Skipping filter definition.
+ 	 */
+ 	public function testInvalidAppenderFilterClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_invalid_filter_class.xml');
+ 	} 	
+ 	
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistant layout class [Foo] specified for appender [foo]. Reverting to default layout.
+ 	 */
+ 	public function testNotExistingAppenderLayoutClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_not_existing_layout_class.xml');
+ 	}
+ 	
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid layout class [stdClass] sepcified for appender [foo]. Reverting to default layout.
+ 	 */
+ 	public function testInvalidAppenderLayoutClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_invalid_layout_class.xml');
+ 	} 
+
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Layout class not specified for appender [foo]. Reverting to default layout.
+ 	 */
+ 	public function testNoAppenderLayoutClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/appenders/config_no_layout_class.xml');
+ 	}   	
+
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid class [stdClass] given. Not a valid LoggerRenderer class. Skipping renderers definition.
+ 	 */
+ 	public function testInvalidRenderingClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/renderers/config_invalid_rendering_class.xml');
+ 	} 	
+ 	
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Rendering class not specified. Skipping renderers definition.
+ 	 */
+ 	public function testNoRenderingClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/renderers/config_no_rendering_class.xml');
+ 	} 	
+
+    /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Rendered class not specified for rendering Class [LoggerRendererDefault]. Skipping renderers definition.
+ 	 */
+ 	public function testNoRenderedClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/renderers/config_no_rendered_class.xml');
+ 	} 	
+ 	
+     /**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistant rendered class [RenderFooClass] specified for renderer [LoggerRendererDefault]. Skipping renderers definition.
+ 	 */
+ 	public function testNotExistingRenderedClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/renderers/config_not_existing_rendered_class.xml');
+ 	} 	
+ 	
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistant rendering class [FooRenderer] specified. Skipping renderers definition.
+ 	 */
+ 	public function testNotExistingRenderingClassSet() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/renderers/config_not_existing_rendering_class.xml');
+ 	} 	
+ 	
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Invalid additivity value [4711] specified for logger [myLogger].
+ 	 */
+ 	public function testInvalidLoggerAddivity() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/loggers/config_invalid_additivity.xml');
+ 	} 
+
+ 	/**
+ 	 * @expectedException PHPUnit_Framework_Error
+ 	 * @expectedExceptionMessage Nonexistnant appender [unknownAppender] linked to logger [myLogger].
+ 	 */
+ 	public function testNotExistingLoggerAppendersClass() {
+ 		Logger::configure(PHPUNIT_CONFIG_DIR . '/loggers/config_not_existing_appenders.xml');
+ 	}  	
+ 	
+ 	/**
  	 * Test that an error is reported when config file is not found. 
  	 * @expectedException PHPUnit_Framework_Error
  	 * @expectedExceptionMessage log4php: Configuration failed. File not found
@@ -63,15 +224,27 @@
  	}
  	
  	public function testAppendersWithLayout() {
- 		Logger::configure(array(
+ 		$config = Logger::configure(array(
  			'rootLogger' => array(
  				'appenders' => array('app1', 'app2')
  			),
+ 			'loggers' => array(
+ 				'myLogger' => array(
+ 					'appenders' => array('app1'),
+ 					'additivity'=> true
+ 				)
+ 			),
+ 			'renderers' => array(
+ 				array('renderedClass' => 'stdClass', 'renderingClass' => 'LoggerRendererDefault')
+ 			),
  			'appenders' => array(
  				'app1' => array(
  					'class' => 'LoggerAppenderEcho',
  					'layout' => array(
  						'class' => 'LoggerLayoutSimple'
+ 					),
+ 					'params' => array(
+ 						'htmlLineBreaks' => false
  					)
  				),
 		 		'app2' => array(
@@ -81,6 +254,15 @@
 		 		 		'params' => array(
 		 		 			'conversionPattern' => 'message: %m%n'
 		 		 		)
+		 			),
+		 			'filters' => array(
+		 				array(
+		 					'class'	=> 'LoggerFilterStringMatch',
+		 					'params'=> array(
+		 						'stringToMatch'	=> 'foo',
+		 						'acceptOnMatch'	=> false
+		 					)
+		 				)
 		 			)
 		 		),
  			) 

Modified: logging/log4php/trunk/src/test/php/bootstrap.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/bootstrap.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/test/php/bootstrap.php (original)
+++ logging/log4php/trunk/src/test/php/bootstrap.php Sat Nov 19 10:32:32 2011
@@ -33,5 +33,9 @@ if (!is_dir($tmpDir)) {
 }
 define('PHPUNIT_TEMP_DIR', realpath($tmpDir));
 
+// Make the path to the configurations dir for easier access
+$confDir = dirname(__FILE__) . '/../resources/configs';
+define('PHPUNIT_CONFIG_DIR', realpath($confDir));
+
 require dirname(__FILE__) . '/../../main/php/Logger.php';
 

Modified: logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterINITest.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterINITest.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterINITest.php (original)
+++ logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterINITest.php Sat Nov 19 10:32:32 2011
@@ -81,7 +81,7 @@ class LoggerConfigurationAdapterINITest 
 	);	
 	
 	public function testConfig() {
-		$url = dirname(__FILE__) . '/config1.ini';
+		$url = PHPUNIT_CONFIG_DIR . '/adapters/ini/config_valid.ini';
 		$adapter = new LoggerConfigurationAdapterINI();
 		$actual = $adapter->convert($url);
 	
@@ -104,7 +104,7 @@ class LoggerConfigurationAdapterINITest 
 	 * @expectedExceptionMessage Error parsing configuration file: syntax error
 	 */
 	public function testInvalidFileException() {
-		$url =  dirname(__FILE__) . '/config2.ini';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/ini/config_invalid_syntax.ini';
 		$adapter = new LoggerConfigurationAdapterINI();
 		$adapter->convert($url);
 	}
@@ -115,7 +115,7 @@ class LoggerConfigurationAdapterINITest 
 	 * @expectedExceptionMessage log4php: Don't know how to parse the following line: "log4php.appender.default.layout.param.bla = LoggerLayoutTTCC". Skipping.
 	 */
 	public function testInvalidLineWarning1() {
-		$url =  dirname(__FILE__) . '/config3.ini';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/ini/config_invalid_appender_declaration_1.ini';
 		$adapter = new LoggerConfigurationAdapterINI();
 		$adapter->convert($url);
 	}
@@ -126,7 +126,7 @@ class LoggerConfigurationAdapterINITest 
 	 * @expectedExceptionMessage log4php: Don't know how to parse the following line: "log4php.appender.default.not-layout.param = LoggerLayoutTTCC". Skipping.
 	 */
 	public function testInvalidLineWarning2() {
-		$url =  dirname(__FILE__) . '/config4.ini';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/ini/config_invalid_appender_declaration_2.ini';
 		$adapter = new LoggerConfigurationAdapterINI();
 		$adapter->convert($url);
 	}

Modified: logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php (original)
+++ logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterPHPTest.php Sat Nov 19 10:32:32 2011
@@ -40,7 +40,7 @@ class LoggerConfigurationAdapterPHPTest 
 	);
 	
 	public function testConfig() {
-		$url = dirname(__FILE__) . '/config1.php';
+		$url = PHPUNIT_CONFIG_DIR . '/adapters/php/config_valid.php';
 		$adapter = new LoggerConfigurationAdapterPHP();
 		$actual = $adapter->convert($url);
 		
@@ -63,7 +63,7 @@ class LoggerConfigurationAdapterPHPTest 
 	 * @expectedExceptionMessage Error parsing configuration: syntax error
 	 */
 	public function testInvalidFileWarning() {
-		$url = dirname(__FILE__) . '/config2.php';
+		$url = PHPUNIT_CONFIG_DIR . '/adapters/php/config_invalid_syntax.php';
 		$adapter = new LoggerConfigurationAdapterPHP();
 		$adapter->convert($url);
 	}
@@ -74,7 +74,7 @@ class LoggerConfigurationAdapterPHPTest 
 	 * @expectedExceptionMessage Invalid configuration: empty configuration array.
 	 */
 	public function testEmptyConfigWarning() {
-		$url = dirname(__FILE__) . '/config3.php';
+		$url = PHPUNIT_CONFIG_DIR . '/adapters/php/config_empty.php';
 		$adapter = new LoggerConfigurationAdapterPHP();
 		$adapter->convert($url);
 	}
@@ -85,12 +85,10 @@ class LoggerConfigurationAdapterPHPTest 
 	 * @expectedExceptionMessage Invalid configuration: not an array.
 	 */
 	public function testInvalidConfigWarning() {
-		$url = dirname(__FILE__) . '/config4.php';
+		$url = PHPUNIT_CONFIG_DIR . '/adapters/php/config_not_an_array.php';
 		$adapter = new LoggerConfigurationAdapterPHP();
 		$adapter->convert($url);
 	}
-
-
 }
 
 ?>
\ No newline at end of file

Modified: logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterXMLTest.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterXMLTest.php?rev=1203964&r1=1203963&r2=1203964&view=diff
==============================================================================
--- logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterXMLTest.php (original)
+++ logging/log4php/trunk/src/test/php/configurators/LoggerConfigurationAdapterXMLTest.php Sat Nov 19 10:32:32 2011
@@ -103,7 +103,7 @@ class LoggerConfigurationAdapterXMLTest 
 	}
 	
 	public function testConversion() {
-		$url =  dirname(__FILE__) . '/config1.xml';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/xml/config_valid.xml';
 		$adapter = new LoggerConfigurationAdapterXML();
 		$actual = $adapter->convert($url);
 		$this->assertEquals($this->expected1, $actual);
@@ -121,14 +121,13 @@ class LoggerConfigurationAdapterXMLTest 
 	
 	/**
 	 * Test exception is thrown when file contains invalid XML.
-	 * @ expectedException LoggerException
-	 * @ expectedExceptionMessage Cannot load config file
+	 * @expectedException LoggerException
+	 * @expectedExceptionMessage Error loading configuration file: Premature end of data in tag configuration line 2
 	 */
 	public function testInvalidXMLFile() {
-		// TODO: fix error reporting for XML files
-		//$url =  dirname(__FILE__) . '/config4.xml';
-		//$adapter = new LoggerConfigurationAdapterXML();
-		//$adapter->convert($url);
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/xml/config_invalid_syntax.xml';
+		$adapter = new LoggerConfigurationAdapterXML();
+		$adapter->convert($url);
 	}
 	
 	/**
@@ -138,7 +137,7 @@ class LoggerConfigurationAdapterXMLTest 
  	 * @expectedExceptionMessage log4php: Duplicate logger definition [foo]. Overwriting
 	 */
 	public function testDuplicateLoggerWarning() {
-		$url =  dirname(__FILE__) . '/config3.xml';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/xml/config_duplicate_logger.xml';
 		$adapter = new LoggerConfigurationAdapterXML();
 		$adapter->convert($url);
 	}
@@ -149,7 +148,7 @@ class LoggerConfigurationAdapterXMLTest 
 	 * one will overwrite the first.
 	 */
 	public function testDuplicateLoggerConfig() {
-		$url =  dirname(__FILE__) . '/config3.xml';
+		$url =  PHPUNIT_CONFIG_DIR . '/adapters/xml/config_duplicate_logger.xml';
 		$adapter = new LoggerConfigurationAdapterXML();
 		
 		// Supress the warning so that test can continue 

Added: logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_1.ini
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_1.ini?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_1.ini (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_1.ini Sat Nov 19 10:32:32 2011
@@ -0,0 +1,7 @@
+log4php.rootLogger = DEBUG, default
+
+log4php.appender.default = LoggerAppenderEcho
+
+# invalid appender line should trigger warning
+log4php.appender.default.layout.param.bla = LoggerLayoutTTCC
+ 
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_2.ini
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_2.ini?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_2.ini (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_appender_declaration_2.ini Sat Nov 19 10:32:32 2011
@@ -0,0 +1,7 @@
+log4php.rootLogger = DEBUG, default
+
+log4php.appender.default = LoggerAppenderEcho
+
+# invalid appender line should trigger warning
+log4php.appender.default.not-layout.param = LoggerLayoutTTCC
+ 
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_syntax.ini
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_syntax.ini?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_syntax.ini (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_invalid_syntax.ini Sat Nov 19 10:32:32 2011
@@ -0,0 +1,2 @@
+not a valid ini file ()
+ 

Added: logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_valid.ini
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_valid.ini?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_valid.ini (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/ini/config_valid.ini Sat Nov 19 10:32:32 2011
@@ -0,0 +1,24 @@
+log4php.rootLogger = DEBUG, default
+
+log4php.appender.default = LoggerAppenderEcho
+log4php.appender.default.layout = LoggerLayoutTTCC
+
+log4php.appender.file = LoggerAppenderDailyFile
+log4php.appender.file.layout = LoggerLayoutPattern
+log4php.appender.file.layout.conversionPattern =%d{ISO8601} [%p] %c: %m (at %F line %L)%n
+log4php.appender.file.datePattern = Ymd
+log4php.appender.file.file = target/examples/daily_%s.log
+log4php.appender.file.threshold = warn
+
+log4php.logger.foo = warn, default
+
+log4php.logger.foo.bar = debug, file
+log4php.additivity.foo.bar = true
+
+log4php.logger.foo.bar.baz = trace, default, file
+log4php.additivity.foo.bar.baz = false
+
+log4php.renderer.Fruit = FruitRenderer
+log4php.renderer.Beer = BeerRenderer
+
+log4php.threshold = debug

Added: logging/log4php/trunk/src/test/resources/configs/adapters/php/config_empty.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/php/config_empty.php?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/php/config_empty.php (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/php/config_empty.php Sat Nov 19 10:32:32 2011
@@ -0,0 +1,5 @@
+<?php
+
+// Empty config
+
+?>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/php/config_invalid_syntax.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/php/config_invalid_syntax.php?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/php/config_invalid_syntax.php (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/php/config_invalid_syntax.php Sat Nov 19 10:32:32 2011
@@ -0,0 +1,20 @@
+<?php
+
+
+return array(
+	'rootLogger' => array(
+		'level' => 'info',
+		'appenders' => array('default')
+	),
+	'appenders' => array(
+		'default' => array(
+			'class' => 'LoggerAppenderEcho',
+			'layout' => array(
+				'class' => 'LoggerLayoutSimple'
+			 )
+		)
+	)
+
+// Invalid file - no closing brace.
+	
+?>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/php/config_not_an_array.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/php/config_not_an_array.php?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/php/config_not_an_array.php (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/php/config_not_an_array.php Sat Nov 19 10:32:32 2011
@@ -0,0 +1,6 @@
+<?php
+
+// Not an array
+return new Exception();
+
+?>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/php/config_valid.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/php/config_valid.php?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/php/config_valid.php (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/php/config_valid.php Sat Nov 19 10:32:32 2011
@@ -0,0 +1,19 @@
+<?php
+
+return array(
+	'rootLogger' => array(
+		'level' => 'info',
+		'appenders' => array('default')
+	),
+	'appenders' => array(
+		'default' => array(
+			'class' => 'LoggerAppenderEcho',
+			'layout' => array(
+				'class' => 'LoggerLayoutSimple'
+			 )
+		)
+	)
+)
+;
+
+?>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_logger.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_logger.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_logger.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_logger.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutSimple"/>
+    </appender>
+    
+    <!-- Duplicate logger -->
+    <logger name="foo">
+        <level value="info" />
+        <appender_ref ref="default" />
+    </logger>
+    
+    <logger name="foo">
+        <level value="warn" />
+        <appender_ref ref="default" />
+    </logger>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_renderer.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_renderer.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_renderer.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_duplicate_renderer.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+	<!-- Duplicate renderer -->
+	<renderer renderedClass="Fruit" renderingClass="FruitRenderer1" />
+	<renderer renderedClass="Fruit" renderingClass="FruitRenderer2" />
+	<renderer renderedClass="Beer" renderingClass="BeerRenderer" />
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutSimple"/>
+    </appender>
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_invalid_syntax.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_invalid_syntax.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_invalid_syntax.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_invalid_syntax.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutSimple"/>
+    </appender>
+    
+    <!-- Duplicate logger -->
+    <logger name="foo">
+        <level value="info" />
+        <appender_ref ref="default" />
+    </logger>
+    
+    <logger name="foo">
+        <level value="warn" />
+        <appender_ref ref="default" />
+    </logger>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+
+    <!-- Invalid XML file for testing -->
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_valid.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_valid.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_valid.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/adapters/xml/config_valid.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+	<renderer renderedClass="Fruit" renderingClass="FruitRenderer" />
+	<renderer renderedClass="Beer" renderingClass="BeerRenderer" />
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutTTCC"/>
+        <filter class="LoggerFilterLevelRange">
+            <param name="levelMin" value="ERROR" />
+            <param name="levelMax" value="FATAL" />
+            <param name="acceptOnMatch" value="false" />
+        </filter>
+        <filter class="LoggerFilterDenyAll" />
+    </appender>
+	<appender name="file" class="LoggerAppenderDailyFile" threshold="warn">
+		<param name="datePattern" value="Ymd" />
+		<param name="file" value="target/examples/daily_%s.log" />
+        <layout class="LoggerLayoutPattern">
+        	<param name="conversionPattern" value= "%d{ISO8601} [%p] %c: %m (at %F line %L)%n" />
+        </layout>
+    </appender>
+    <logger name="foo.bar.baz" additivity="false">
+        <level value="trace" />
+        <appender_ref ref="default" />
+    </logger>
+    <logger name="foo.bar" additivity="true">
+        <level value="debug" />
+        <appender_ref ref="file" />
+    </logger>
+    <logger name="foo">
+        <level value="warn" />
+        <appender_ref ref="default" />
+        <appender_ref ref="file" />
+    </logger>
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_appender_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_appender_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_appender_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_appender_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+    <appender name="foo" class="stdClass"/>
+
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<filter class="stdClass" />
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_parameters.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_parameters.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_parameters.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_filter_parameters.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+        <filter class="LoggerFilterStringMatch">
+            <param name="fooParameter" value="bar" />
+        </filter>
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_layout_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_layout_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_layout_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_invalid_layout_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="stdClass" />
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_no_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_no_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_no_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_no_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+
+    <appender name="foo" />
+
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_no_layout_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_no_layout_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_no_layout_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_no_layout_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="" />
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+    <appender name="foo" class="unknownClass"/>
+
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_filter_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_filter_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_filter_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_filter_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<filter class="Foo" />
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_layout_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_layout_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_layout_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/appenders/config_not_existing_layout_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="Foo" />
+    </appender>
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/config.yml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/config.yml?rev=1203964&view=auto
==============================================================================
    (empty)

Added: logging/log4php/trunk/src/test/resources/configs/config1.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/config1.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/config1.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/config1.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+	<renderer renderedClass="Fruit" renderingClass="FruitRenderer" />
+	<renderer renderedClass="Beer" renderingClass="BeerRenderer" />
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutTTCC"/>
+        <filter class="LoggerFilterLevelRange">
+            <param name="levelMin" value="ERROR" />
+            <param name="levelMax" value="FATAL" />
+            <param name="acceptOnMatch" value="false" />
+        </filter>
+        <filter class="LoggerFilterDenyAll" />
+    </appender>
+	<appender name="file" class="LoggerAppenderDailyFile" threshold="warn">
+		<param name="datePattern" value="Ymd" />
+		<param name="file" value="target/examples/daily_%s.log" />
+        <layout class="LoggerLayoutPattern">
+        	<param name="conversionPattern" value= "%d{ISO8601} [%p] %c: %m (at %F line %L)%n" />
+        </layout>
+    </appender>
+    <logger name="foo.bar.baz" additivity="false">
+        <level value="trace" />
+        <appender_ref ref="default" />
+    </logger>
+    <logger name="foo.bar" additivity="true">
+        <level value="debug" />
+        <appender_ref ref="file" />
+    </logger>
+    <logger name="foo">
+        <level value="warn" />
+        <appender_ref ref="default" />
+        <appender_ref ref="file" />
+    </logger>
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/loggers/config_invalid_additivity.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/loggers/config_invalid_additivity.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/loggers/config_invalid_additivity.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/loggers/config_invalid_additivity.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+    <appender name="default" class="LoggerAppenderEcho">
+        <layout class="LoggerLayoutTTCC"/>
+    </appender>
+    <logger name="myLogger" additivity="4711">
+        <level value="warn" />
+        <appender_ref ref="default" />
+    </logger>
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="default" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/loggers/config_not_existing_appenders.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/loggers/config_not_existing_appenders.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/loggers/config_not_existing_appenders.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/loggers/config_not_existing_appenders.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php" threshold="debug">
+    <logger name="myLogger">
+        <level value="warn" />
+        <appender_ref ref="unknownAppender" />
+    </logger>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/renderers/config_invalid_rendering_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/renderers/config_invalid_rendering_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/renderers/config_invalid_rendering_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/renderers/config_invalid_rendering_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="LoggerLayoutTTCC"/>
+    </appender>
+    
+    <renderer renderedClass="stdClass" renderingClass="stdClass"  />
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendered_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendered_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendered_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendered_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="LoggerLayoutTTCC"/>
+    </appender>
+    
+    <renderer renderingClass="LoggerRendererDefault" />
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendering_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendering_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendering_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/renderers/config_no_rendering_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="LoggerLayoutTTCC"/>
+    </appender>
+    
+    <renderer />
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>
\ No newline at end of file

Added: logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendered_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendered_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendered_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendered_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="LoggerLayoutTTCC"/>
+    </appender>
+    
+    <renderer renderedClass="RenderFooClass" renderingClass="LoggerRendererDefault" />
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>

Added: logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendering_class.xml
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendering_class.xml?rev=1203964&view=auto
==============================================================================
--- logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendering_class.xml (added)
+++ logging/log4php/trunk/src/test/resources/configs/renderers/config_not_existing_rendering_class.xml Sat Nov 19 10:32:32 2011
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration xmlns="http://logging.apache.org/log4php">
+    <appender name="foo" class="LoggerAppenderConsole">
+    	<layout class="LoggerLayoutTTCC"/>
+    </appender>
+    
+    <renderer renderedClass="stdClass" renderingClass="FooRenderer" />
+    
+    <root>
+        <level value="DEBUG" />
+        <appender_ref ref="foo" />
+    </root>
+</configuration>



Mime
View raw message