Changeset 1411

Show
Ignore:
Timestamp:
03/11/08 10:36:06 (6 months ago)
Author:
mikey
Message:

renamed from factory to initializer as it is not a real factory and should fit into general naming scheme

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/util/log/stubLoggerXJConfInitializer.php

    r1400 r1411  
    1919 * @uses        http://php.xjconf.net/ 
    2020 */ 
    21 class stubLoggerXJConfFactory extends stubXJConfAbstractInitializer implements stubLoggerInitializer 
     21class stubLoggerXJConfInitializer extends stubXJConfAbstractInitializer implements stubLoggerInitializer 
    2222{ 
    2323    /** 
  • trunk/src/main/php/net/stubbles/util/stubGeneralInitializer.php

    r1410 r1411  
    3434     * @var  array<string,string> 
    3535     */ 
    36     protected $classes  = array('logger' => 'net::stubbles::util::log::stubLoggerXJConfFactory', 
     36    protected $classes  = array('logger' => 'net::stubbles::util::log::stubLoggerXJConfInitializer', 
    3737                                'rdbms'  => 'net::stubbles::rdbms::stubDatabaseXJConfInitializer', 
    3838                                'cache'  => 'net::stubbles::util::cache::stubCacheXJConfInitializer', 
  • trunk/src/test/php/net/stubbles/integration/LoggerTestCase.php

    r1308 r1411  
    77 * @subpackage  test_integration 
    88 */ 
    9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfFactory'); 
     9stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfInitializer'); 
    1010/** 
    1111 * Integration test for logger. 
     
    3232    protected function initFactory() 
    3333    { 
    34         $loggerXJConfFactory = new stubLoggerXJConfFactory(); 
     34        $loggerXJConfFactory = new stubLoggerXJConfInitializer(); 
    3535        $loggerXJConfFactory->init(); 
    3636    } 
  • trunk/src/test/php/net/stubbles/util/UtilTestSuite.php

    r1407 r1411  
    4646        $suite->addTestFile($dir . '/log/stubBaseLogDataTestCase.php'); 
    4747        $suite->addTestFile($dir . '/log/stubLogDataFactoryTestCase.php'); 
    48         $suite->addTestFile($dir . '/log/stubLoggerXJConfFactoryTestCase.php'); 
     48        $suite->addTestFile($dir . '/log/stubLoggerXJConfInitializerTestCase.php'); 
    4949        $suite->addTestFile($dir . '/log/stubMemoryLogAppenderTestCase.php'); 
    5050 
  • trunk/src/test/php/net/stubbles/util/log/stubLoggerXJConfInitializerTestCase.php

    r1288 r1411  
    11<?php 
    22/** 
    3  * Tests for net::stubbles::util::log::stubLoggerXJConfFactory
     3 * Tests for net::stubbles::util::log::stubLoggerXJConfInitializer
    44 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    77 * @subpackage  util_log_test 
    88 */ 
    9 stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfFactory'); 
     9stubClassLoader::load('net::stubbles::util::log::stubLoggerXJConfInitializer'); 
    1010PHPUnit_Framework_MockObject_Mock::generate('stubLogAppender', array(), 'MockstubLogAppender1'); 
    1111PHPUnit_Framework_MockObject_Mock::generate('stubLogAppender', array(), 'MockstubLogAppender2'); 
     
    2121} 
    2222/** 
    23  * Tests for net::stubbles::util::log::stubLoggerXJConfFactory
     23 * Tests for net::stubbles::util::log::stubLoggerXJConfInitializer
    2424 * 
    2525 * @package     stubbles 
    2626 * @subpackage  util_log_test 
    2727 */ 
    28 class stubLoggerXJConfFactoryTestCase extends PHPUnit_Framework_TestCase 
     28class stubLoggerXJConfInitializerTestCase extends PHPUnit_Framework_TestCase 
    2929{ 
    3030    /** 
    3131     * instance to test 
    3232     * 
    33      * @var  stubLoggerXJConfFactory 
     33     * @var  stubLoggerXJConfInitializer 
    3434     */ 
    35     protected $loggerXJConfFactory
     35    protected $loggerXJConfInitializer
    3636 
    3737    /** 
     
    4040    public function setUp() 
    4141    { 
    42         $this->loggerXJConfFactory = new stubLoggerXJConfFactory(); 
     42        $this->loggerXJConfInitializer = new stubLoggerXJConfInitializer(); 
    4343    } 
    4444 
     
    6161    public function descriptor() 
    6262    { 
    63         $this->assertEquals('logging', $this->loggerXJConfFactory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG)); 
    64         $this->assertEquals('logging', $this->loggerXJConfFactory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION)); 
    65         $this->assertEquals('logging', $this->loggerXJConfFactory->getDescriptor('foo')); 
    66         $this->loggerXJConfFactory->setDescriptor('test'); 
    67         $this->assertEquals('test', $this->loggerXJConfFactory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_CONFIG)); 
    68         $this->assertEquals('logging', $this->loggerXJConfFactory->getDescriptor(stubXJConfInitializer::DESCRIPTOR_DEFINITION)); 
    69         $this->assertEquals('logging', $this->loggerXJConfFactory->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')); 
    7070    } 
    7171 
     
    9191        $mockLogAppender3->expects($this->any())->method('getConfig')->will($this->returnValue(array('foo' => 'baz'))); 
    9292        $logger2->addLogAppender($mockLogAppender3); 
    93         $cacheData = $this->loggerXJConfFactory->getCacheData(); 
     93        $cacheData = $this->loggerXJConfInitializer->getCacheData(); 
    9494        $this->assertEquals(array('default' => array('level'    => stubLogger::LEVEL_INFO, 
    9595                                                     'appender' => array('MockstubLogAppender1' => array('foo' => 'bar')), 
     
    121121                                        ) 
    122122                     ); 
    123         $this->loggerXJConfFactory->setCacheData($cacheData); 
     123        $this->loggerXJConfInitializer->setCacheData($cacheData); 
    124124        $this->assertEquals(stubLogger::getInstanceList(), array('default', 'other')); 
    125125        $logger1 = stubLogger::getInstance('default'); 
  • trunk/src/test/php/net/stubbles/util/stubGeneralInitializerTestCase.php

    r1407 r1411  
    2727        $initializer = $generalInitializer->getLoggerInitializer(); 
    2828        $this->assertType('stubLoggerInitializer', $initializer); 
    29         $this->assertType('stubLoggerXJConfFactory', $initializer); 
     29        $this->assertType('stubLoggerXJConfInitializer', $initializer); 
    3030    } 
    3131