Changeset 400

Show
Ignore:
Timestamp:
03/18/07 20:39:30 (1 year ago)
Author:
mikey
Message:

added integration tests (closes ticket #8)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.xml

    r231 r400  
    2929    </if> 
    3030  </target> 
     31   
     32  <target name="test-integration" description="run test suite"> 
     33    <if> 
     34      <isset property="package" /> 
     35      <then> 
     36        <phing phingfile="${build.base.dir}/${package}/build.xml" target="test-integration" inheritAll="false" /> 
     37      </then> 
     38      <else> 
     39        <phing phingfile="${build.base.dir}/stubbles/build.xml" target="test-integration" inheritAll="false" /> 
     40      </else> 
     41    </if> 
     42  </target> 
    3143</project> 
  • trunk/build/stubbles/build.xml

    r389 r400  
    77  <taskDef name="mySimpletest" classname="MySimpleTestTask" classpath="${project.basedir}/../../src/test" /> 
    88 
    9   <target name="main" if="version" depends="test,versioncheck,copy-files,build-archives,tar"/> 
     9  <target name="main" if="version" depends="test,test-integration,versioncheck,copy-files,build-archives,tar"/> 
    1010 
    1111  <target name="versioncheck" unless="version"> 
     
    8484 
    8585    <property name="tgzfile" value="${build.base.dir}/${pkg.name}.tgz"/> 
    86     <delete    file="${tgzfile}"/> 
     86    <delete file="${tgzfile}"/> 
    8787    <tar compression="gzip" destFile="${tgzfile}" basedir="${build.base.dir}"> 
    8888      <fileset dir="${build.base.dir}"> 
     
    9595    <mySimpletest testfile="&quot;${project.basedir}/../../src/test/run.php&quot;" exit="true" /> 
    9696  </target> 
     97   
     98  <target name="test-integration"> 
     99    <mySimpletest testfile="&quot;${project.basedir}/../../src/test/runIntegration.php&quot;" exit="true" /> 
     100  </target> 
    97101</project> 
  • trunk/config/xml/rdbms.xml

    r319 r400  
    55  <pool> 
    66    <connection> 
    7       <dsn>foo</dsn> 
    8       <userName>bar</userName> 
    9       <password>baz</password> 
     7      <dsn>mysql:host=localhost;dbname=example</dsn> 
     8      <userName>root</userName> 
     9      <password>foo</password> 
    1010    </connection> 
    1111  </pool> 
  • trunk/src/main/php/net/stubbles/rdbms/stubDatabaseConnectionData.php

    r244 r400  
    1818     * id of the default connection 
    1919     */ 
    20     const ID_DEFAULT         = '__default'; 
     20    const DEFAULT_ID         = '__default'; 
    2121    /** 
    2222     * id to use for the connection 
     
    2424     * @var  string 
    2525     */ 
    26     protected $id            = self::ID_DEFAULT
     26    protected $id            = self::DEFAULT_ID
    2727    /** 
    2828     * the full qualified name of the class to use for the connection 
  • trunk/src/main/php/net/stubbles/rdbms/stubDatabaseConnectionPool.php

    r174 r400  
    4343     * @throws  stubDatabaseException 
    4444     */ 
    45     public static function getConnection($id = stubDatabaseConnectionData::ID_DEFAULT
     45    public static function getConnection($id = stubDatabaseConnectionData::DEFAULT_ID
    4646    { 
    4747        if (isset(self::$connections[$id]) == false) { 
     
    8282     * @return  bool 
    8383     */ 
    84     public static function hasConnectionData($id = stubDatabaseConnectionData::ID_DEFAULT
     84    public static function hasConnectionData($id = stubDatabaseConnectionData::DEFAULT_ID
    8585    { 
    8686        return isset(self::$connectionData[$id]); 
     
    9393     * @return  stubDatabaseConnectionData 
    9494     */ 
    95     public static function getConnectionData($id = stubDatabaseConnectionData::ID_DEFAULT
     95    public static function getConnectionData($id = stubDatabaseConnectionData::DEFAULT_ID
    9696    { 
    9797        if (isset(self::$connectionData[$id]) == true) { 
     
    107107     * @param   string  $id  optional  id of the connection data to remove 
    108108     */ 
    109     public static function removeConnectionData($id = stubDatabaseConnectionData::ID_DEFAULT
     109    public static function removeConnectionData($id = stubDatabaseConnectionData::DEFAULT_ID
    110110    { 
    111111        if (isset(self::$connectionData[$id]) == true) { 
     
    121121     * @param  string  $id  optional  id of the connection to close 
    122122     */ 
    123     public static function closeConnection($id = stubDatabaseConnectionData::ID_DEFAULT
     123    public static function closeConnection($id = stubDatabaseConnectionData::DEFAULT_ID
    124124    { 
    125125        if (isset(self::$connections[$id]) == true) { 
  • trunk/src/main/php/net/stubbles/util/log/stubFileLogAppender.php

    r373 r400  
    5353     
    5454    /** 
     55     * returns the logpath 
     56     * 
     57     * @return  string 
     58     */ 
     59    public function getLogDir() 
     60    { 
     61        return $this->logDir; 
     62    } 
     63     
     64    /** 
    5565     * builds the log directory 
    5666     * 
  • trunk/src/main/php/net/stubbles/util/log/stubLogger.php

    r146 r400  
    127127     
    128128    /** 
     129     * returns a list of existing instances 
     130     * 
     131     * @return  array<string> 
     132     */ 
     133    public static function getInstanceList() 
     134    { 
     135        return array_keys(self::$instances); 
     136    } 
     137     
     138    /** 
    129139     * destroys the logger with the given id 
    130140     * 
     
    191201    { 
    192202        $this->logAppender[] = $logAppender; 
     203    } 
     204     
     205    /** 
     206     * returns a list of log appenders appended to the logger 
     207     * 
     208     * @return  array<stubLogAppender> 
     209     */ 
     210    public function getLogAppenders() 
     211    { 
     212        return $this->logAppender; 
    193213    } 
    194214     
  • trunk/src/test/php/net/stubbles/rdbms/stubDatabaseConnectionDataTestCase.php

    r248 r400  
    2222    { 
    2323        $connectionData = new stubDatabaseConnectionData(); 
    24         $this->assertEqual($connectionData->getId(), stubDatabaseConnectionData::ID_DEFAULT); 
     24        $this->assertEqual($connectionData->getId(), stubDatabaseConnectionData::DEFAULT_ID); 
    2525        $this->assertEqual($connectionData->getConnectionClassName(), 'net.stubbles.rdbms.pdo.stubDatabasePDOConnection'); 
    2626        $this->assertEqual($connectionData->getDSN(), '');