Changeset 1411
- Timestamp:
- 03/11/08 10:36:06 (6 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/util/log/stubLoggerXJConfInitializer.php (moved) (moved from trunk/src/main/php/net/stubbles/util/log/stubLoggerXJConfFactory.php) (1 diff)
- trunk/src/main/php/net/stubbles/util/stubGeneralInitializer.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/integration/LoggerTestCase.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/util/UtilTestSuite.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/util/log/stubLoggerXJConfInitializerTestCase.php (moved) (moved from trunk/src/test/php/net/stubbles/util/log/stubLoggerXJConfFactoryTestCase.php) (7 diffs)
- trunk/src/test/php/net/stubbles/util/stubGeneralInitializerTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/log/stubLoggerXJConfInitializer.php
r1400 r1411 19 19 * @uses http://php.xjconf.net/ 20 20 */ 21 class stubLoggerXJConf Factoryextends stubXJConfAbstractInitializer implements stubLoggerInitializer21 class stubLoggerXJConfInitializer extends stubXJConfAbstractInitializer implements stubLoggerInitializer 22 22 { 23 23 /** trunk/src/main/php/net/stubbles/util/stubGeneralInitializer.php
r1410 r1411 34 34 * @var array<string,string> 35 35 */ 36 protected $classes = array('logger' => 'net::stubbles::util::log::stubLoggerXJConf Factory',36 protected $classes = array('logger' => 'net::stubbles::util::log::stubLoggerXJConfInitializer', 37 37 'rdbms' => 'net::stubbles::rdbms::stubDatabaseXJConfInitializer', 38 38 'cache' => 'net::stubbles::util::cache::stubCacheXJConfInitializer', trunk/src/test/php/net/stubbles/integration/LoggerTestCase.php
r1308 r1411 7 7 * @subpackage test_integration 8 8 */ 9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConf Factory');9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfInitializer'); 10 10 /** 11 11 * Integration test for logger. … … 32 32 protected function initFactory() 33 33 { 34 $loggerXJConfFactory = new stubLoggerXJConf Factory();34 $loggerXJConfFactory = new stubLoggerXJConfInitializer(); 35 35 $loggerXJConfFactory->init(); 36 36 } trunk/src/test/php/net/stubbles/util/UtilTestSuite.php
r1407 r1411 46 46 $suite->addTestFile($dir . '/log/stubBaseLogDataTestCase.php'); 47 47 $suite->addTestFile($dir . '/log/stubLogDataFactoryTestCase.php'); 48 $suite->addTestFile($dir . '/log/stubLoggerXJConf FactoryTestCase.php');48 $suite->addTestFile($dir . '/log/stubLoggerXJConfInitializerTestCase.php'); 49 49 $suite->addTestFile($dir . '/log/stubMemoryLogAppenderTestCase.php'); 50 50 trunk/src/test/php/net/stubbles/util/log/stubLoggerXJConfInitializerTestCase.php
r1288 r1411 1 1 <?php 2 2 /** 3 * Tests for net::stubbles::util::log::stubLoggerXJConf Factory.3 * Tests for net::stubbles::util::log::stubLoggerXJConfInitializer. 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> … … 7 7 * @subpackage util_log_test 8 8 */ 9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConf Factory');9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfInitializer'); 10 10 PHPUnit_Framework_MockObject_Mock::generate('stubLogAppender', array(), 'MockstubLogAppender1'); 11 11 PHPUnit_Framework_MockObject_Mock::generate('stubLogAppender', array(), 'MockstubLogAppender2'); … … 21 21 } 22 22 /** 23 * Tests for net::stubbles::util::log::stubLoggerXJConf Factory.23 * Tests for net::stubbles::util::log::stubLoggerXJConfInitializer. 24 24 * 25 25 * @package stubbles 26 26 * @subpackage util_log_test 27 27 */ 28 class stubLoggerXJConf FactoryTestCase extends PHPUnit_Framework_TestCase28 class stubLoggerXJConfInitializerTestCase extends PHPUnit_Framework_TestCase 29 29 { 30 30 /** 31 31 * instance to test 32 32 * 33 * @var stubLoggerXJConf Factory33 * @var stubLoggerXJConfInitializer 34 34 */ 35 protected $loggerXJConf Factory;35 protected $loggerXJConfInitializer; 36 36 37 37 /** … … 40 40 public function setUp() 41 41 { 42 $this->loggerXJConf Factory = new stubLoggerXJConfFactory();42 $this->loggerXJConfInitializer = new stubLoggerXJConfInitializer(); 43 43 } 44 44 … … 61 61 public function descriptor() 62 62 { 63 $this->assertEquals('logging', $this->loggerXJConf Factory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG));64 $this->assertEquals('logging', $this->loggerXJConf Factory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION));65 $this->assertEquals('logging', $this->loggerXJConf Factory->getDescriptor('foo'));66 $this->loggerXJConf Factory->setDescriptor('test');67 $this->assertEquals('test', $this->loggerXJConf Factory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG));68 $this->assertEquals('logging', $this->loggerXJConf Factory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION));69 $this->assertEquals('logging', $this->loggerXJConf Factory->getDescriptor('foo'));63 $this->assertEquals('logging', $this->loggerXJConfInitializer->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG)); 64 $this->assertEquals('logging', $this->loggerXJConfInitializer->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION)); 65 $this->assertEquals('logging', $this->loggerXJConfInitializer->getDescriptor('foo')); 66 $this->loggerXJConfInitializer->setDescriptor('test'); 67 $this->assertEquals('test', $this->loggerXJConfInitializer->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG)); 68 $this->assertEquals('logging', $this->loggerXJConfInitializer->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION)); 69 $this->assertEquals('logging', $this->loggerXJConfInitializer->getDescriptor('foo')); 70 70 } 71 71 … … 91 91 $mockLogAppender3->expects($this->any())->method('getConfig')->will($this->returnValue(array('foo' => 'baz'))); 92 92 $logger2->addLogAppender($mockLogAppender3); 93 $cacheData = $this->loggerXJConf Factory->getCacheData();93 $cacheData = $this->loggerXJConfInitializer->getCacheData(); 94 94 $this->assertEquals(array('default' => array('level' => stubLogger::LEVEL_INFO, 95 95 'appender' => array('MockstubLogAppender1' => array('foo' => 'bar')), … … 121 121 ) 122 122 ); 123 $this->loggerXJConf Factory->setCacheData($cacheData);123 $this->loggerXJConfInitializer->setCacheData($cacheData); 124 124 $this->assertEquals(stubLogger::getInstanceList(), array('default', 'other')); 125 125 $logger1 = stubLogger::getInstance('default'); trunk/src/test/php/net/stubbles/util/stubGeneralInitializerTestCase.php
r1407 r1411 27 27 $initializer = $generalInitializer->getLoggerInitializer(); 28 28 $this->assertType('stubLoggerInitializer', $initializer); 29 $this->assertType('stubLoggerXJConf Factory', $initializer);29 $this->assertType('stubLoggerXJConfInitializer', $initializer); 30 30 } 31 31
