Changeset 462

Show
Ignore:
Timestamp:
06/18/07 16:50:39 (2 years ago)
Author:
laurentj
Message:

fixed bug on junittests module

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-dev.mn

    r461 r462  
    169169  junittestcasedb.class.php 
    170170cd lib/jelix-modules/junittests/controllers 
    171   default.class.php 
     171  default.classic.php 
    172172cd lib/jelix-modules/junittests/templates 
    173173  main.tpl 
  • trunk/build/manifests/jelix-dev.mn

    r461 r462  
    169169  junittestcasedb.class.php 
    170170cd lib/jelix-modules/junittests/controllers 
    171   default.class.php 
     171  default.classic.php 
    172172cd lib/jelix-modules/junittests/templates 
    173173  main.tpl 
  • trunk/build/manifests/testapp.mn

    r444 r462  
    7373  utparseurls.class.php 
    7474  utselectoract.class.php 
    75   utselectormod.class.php 
    7675  utsimpletest.class.php 
    7776  utjdb.class.php 
     
    118117  products.dao.xml 
    119118 
     119cd testapp/modules/unittest/tests/ 
     120  module_selectors.html.php 
     121 
    120122cd testapp/var 
    121123  .htaccess 
  • trunk/build/manifests/testapp.mn

    r444 r462  
    7373  utparseurls.class.php 
    7474  utselectoract.class.php 
    75   utselectormod.class.php 
    7675  utsimpletest.class.php 
    7776  utjdb.class.php 
     
    118117  products.dao.xml 
    119118 
     119cd testapp/modules/unittest/tests/ 
     120  module_selectors.html.php 
     121 
    120122cd testapp/var 
    121123  .htaccess 
  • trunk/lib/jelix-modules/junittests/classes/jhtmlrespreporter.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package    testapp 
    4 * @subpackage unittest 
     3* @package    jelix 
     4* @subpackage junittests 
    55* @author     Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/classes/jhtmlrespreporter.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package    testapp 
    4 * @subpackage unittest 
     3* @package    jelix 
     4* @subpackage junittests 
    55* @author     Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/classes/junittestcasedb.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/classes/junittestcasedb.class.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
  • trunk/lib/jelix-modules/junittests/controllers/default.classic.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package 
    4 * @subpackage  
    5 * @author 
    6 * @copyright 
    7 * @link 
    8 * @licence  http://www.gnu.org/licenses/gpl.html GNU General Public Licence, see LICENCE file 
     3* @package     jelix 
     4* @subpackage  junittests 
     5* @author      Jouanneau Laurent 
     6* @contributor 
     7* @copyright   2007 Jouanneau laurent 
     8* @link        http://www.jelix.org 
     9* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    910*/ 
    10  
    1111 
    1212class defaultCtrl extends jController { 
     
    5757            } 
    5858        } 
     59        jContext::push($module); 
    5960        $group->run($reporter); 
     61        jContext::pop(); 
     62 
    6063 
    6164        return $this->_finishResponse($rep); 
     
    7477        $rep = $this->_prepareResponse(); 
    7578 
    76         $module = $this->param('module'); 
     79        $module = $this->param('mod'); 
    7780        if(isset($this->testsList[$module])){ 
    7881            $reporter = jClasses::create("jhtmlrespreporter"); 
     
    8588                $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    8689            } 
     90            jContext::push($module); 
    8791            $group->run($reporter); 
    88  
     92            jContext::pop(); 
    8993        } 
    9094        return $this->_finishResponse($rep); 
     
    103107        $rep = $this->_prepareResponse(); 
    104108 
    105         $module = $this->param('module'); 
     109        $module = $this->param('mod'); 
    106110        $testname = $this->param('test'); 
    107111 
     
    112116            $reporter->setResponse($rep); 
    113117 
    114              
    115118            foreach($this->testsList[$module] as $test){ 
    116119                if($test[1] == $testname){ 
    117120                    $group = new GroupTest('"'.$module. '" module : "'.$testname.'" Tests'); 
    118121                    $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
     122                    jContext::push($module); 
    119123                    $group->run($reporter); 
     124                    jContext::pop(); 
    120125                    break; 
    121126                } 
    122127            } 
    123         } 
     128        }else 
     129            $rep->body->assign ('MAIN','<p>no tests for "'.$module.'" module.</p>'); 
    124130        return $this->_finishResponse($rep); 
    125131    } 
  • trunk/lib/jelix-modules/junittests/controllers/default.classic.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package 
    4 * @subpackage  
    5 * @author 
    6 * @copyright 
    7 * @link 
    8 * @licence  http://www.gnu.org/licenses/gpl.html GNU General Public Licence, see LICENCE file 
     3* @package     jelix 
     4* @subpackage  junittests 
     5* @author      Jouanneau Laurent 
     6* @contributor 
     7* @copyright   2007 Jouanneau laurent 
     8* @link        http://www.jelix.org 
     9* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    910*/ 
    10  
    1111 
    1212class defaultCtrl extends jController { 
     
    5757            } 
    5858        } 
     59        jContext::push($module); 
    5960        $group->run($reporter); 
     61        jContext::pop(); 
     62 
    6063 
    6164        return $this->_finishResponse($rep); 
     
    7477        $rep = $this->_prepareResponse(); 
    7578 
    76         $module = $this->param('module'); 
     79        $module = $this->param('mod'); 
    7780        if(isset($this->testsList[$module])){ 
    7881            $reporter = jClasses::create("jhtmlrespreporter"); 
     
    8588                $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
    8689            } 
     90            jContext::push($module); 
    8791            $group->run($reporter); 
    88  
     92            jContext::pop(); 
    8993        } 
    9094        return $this->_finishResponse($rep); 
     
    103107        $rep = $this->_prepareResponse(); 
    104108 
    105         $module = $this->param('module'); 
     109        $module = $this->param('mod'); 
    106110        $testname = $this->param('test'); 
    107111 
     
    112116            $reporter->setResponse($rep); 
    113117 
    114              
    115118            foreach($this->testsList[$module] as $test){ 
    116119                if($test[1] == $testname){ 
    117120                    $group = new GroupTest('"'.$module. '" module : "'.$testname.'" Tests'); 
    118121                    $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module].'tests/'.$test[0]); 
     122                    jContext::push($module); 
    119123                    $group->run($reporter); 
     124                    jContext::pop(); 
    120125                    break; 
    121126                } 
    122127            } 
    123         } 
     128        }else 
     129            $rep->body->assign ('MAIN','<p>no tests for "'.$module.'" module.</p>'); 
    124130        return $this->_finishResponse($rep); 
    125131    } 
  • trunk/lib/jelix-modules/junittests/templates/main.tpl

    r461 r462  
    2020    <ul> 
    2121    {foreach $modules as $module=>$tests} 
    22         <li><a href="{jurl 'junittests~default_module', array('module'=>$module)}">{$module}</a> 
     22        <li><a href="{jurl 'junittests~default_module', array('mod'=>$module)}">{$module}</a> 
    2323            <ul> 
    2424        {foreach $tests as $test} 
    25                 <li><a href="{jurl 'junittests~default_single', array('module'=>$module, 'test'=>$test[1])}">{$test[1]}</a> 
     25                <li><a href="{jurl 'junittests~default_single', array('mod'=>$module, 'test'=>$test[1])}">{$test[1]}</a> 
    2626        {/foreach} 
    2727            </ul> 
  • trunk/lib/jelix-modules/junittests/templates/main.tpl

    r461 r462  
    2020    <ul> 
    2121    {foreach $modules as $module=>$tests} 
    22         <li><a href="{jurl 'junittests~default_module', array('module'=>$module)}">{$module}</a> 
     22        <li><a href="{jurl 'junittests~default_module', array('mod'=>$module)}">{$module}</a> 
    2323            <ul> 
    2424        {foreach $tests as $test} 
    25                 <li><a href="{jurl 'junittests~default_single', array('module'=>$module, 'test'=>$test[1])}">{$test[1]}</a> 
     25                <li><a href="{jurl 'junittests~default_single', array('mod'=>$module, 'test'=>$test[1])}">{$test[1]}</a> 
    2626        {/foreach} 
    2727            </ul> 
  • trunk/testapp/modules/unittest/classes/unittestservice.class.php

    r444 r462  
    4040   function selectorActTest(){ 
    4141      $test = jClasses::create("utselectoract"); 
    42       $test->run(new jHtmlRespReporter($this->_rep)); 
    43    } 
    44    function selectorModTest(){ 
    45       $test = jClasses::create("utselectormod"); 
    4642      $test->run(new jHtmlRespReporter($this->_rep)); 
    4743   } 
  • trunk/testapp/modules/unittest/classes/unittestservice.class.php

    r444 r462  
    4040   function selectorActTest(){ 
    4141      $test = jClasses::create("utselectoract"); 
    42       $test->run(new jHtmlRespReporter($this->_rep)); 
    43    } 
    44    function selectorModTest(){ 
    45       $test = jClasses::create("utselectormod"); 
    4642      $test->run(new jHtmlRespReporter($this->_rep)); 
    4743   } 
  • trunk/testapp/modules/unittest/controllers/default.classic.php

    r390 r462  
    6666      return $rep; 
    6767   } 
    68    function testselectormod(){ 
    69       $rep = $this->getResponse('unittest'); 
    70       $rep->title = 'test unitaires sur les selecteurs normaux'; 
    71  
    72       $ut = jClasses::create("unittestservice"); 
    73       $ut->init($rep); 
    74       $ut->selectorModTest(); 
    75       return $rep; 
    76    } 
    77  
    7868 
    7969   function testsimpletest() { 
  • trunk/testapp/modules/unittest/controllers/default.classic.php

    r390 r462  
    6666      return $rep; 
    6767   } 
    68    function testselectormod(){ 
    69       $rep = $this->getResponse('unittest'); 
    70       $rep->title = 'test unitaires sur les selecteurs normaux'; 
    71  
    72       $ut = jClasses::create("unittestservice"); 
    73       $ut->init($rep); 
    74       $ut->selectorModTest(); 
    75       return $rep; 
    76    } 
    77  
    7868 
    7969   function testsimpletest() { 
  • trunk/testapp/modules/unittest/templates/menu.tpl

    r444 r462  
    66<h3>Core</h3> 
    77<ul> 
    8     <li><a href="?module=unittest&amp;action=default_testselectormod">selecteurs normaux</a></li> <!--{jurl 'unittest~testselectormod'} --> 
    98    <li><a href="?module=unittest&amp;action=testselectoract">selecteurs d'action</a></li> <!--{jurl 'unittest~default_testselectoract'} --> 
    109    <li><a href="?module=unittest&amp;action=testlocaleprop">lecture .properties</a></li> 
  • trunk/testapp/modules/unittest/templates/menu.tpl

    r444 r462  
    66<h3>Core</h3> 
    77<ul> 
    8     <li><a href="?module=unittest&amp;action=default_testselectormod">selecteurs normaux</a></li> <!--{jurl 'unittest~testselectormod'} --> 
    98    <li><a href="?module=unittest&amp;action=testselectoract">selecteurs d'action</a></li> <!--{jurl 'unittest~default_testselectoract'} --> 
    109    <li><a href="?module=unittest&amp;action=testlocaleprop">lecture .properties</a></li> 
  • trunk/testapp/modules/unittest/tests/module_selectors.html.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest module 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
     
    2323                $this->assertTrue($valid,  ' test de jSelectorZone('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.')'); 
    2424            }catch(jExceptionSelector $e){ 
    25                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     25                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    2626            }catch(Exception $e){ 
    2727                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
     
    4545                $this->assertTrue($valid,  ' test de jSelectorClass('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.','.$s->subpath.','.$s->className.')'); 
    4646            }catch(jExceptionSelector $e){ 
    47                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     47                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    4848            }catch(Exception $e){ 
    4949                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
     
    102102                $this->assertTrue($valid,  ' test de jSelectorInterface('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.','.$s->subpath.','.$s->className.')'); 
    103103            }catch(jExceptionSelector $e){ 
    104                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     104                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    105105            }catch(Exception $e){ 
    106106                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
  • trunk/testapp/modules/unittest/tests/module_selectors.html.php

    r461 r462  
    11<?php 
    22/** 
    3 * @package     testapp 
    4 * @subpackage  unittest module 
     3* @package     jelix 
     4* @subpackage  junittests 
    55* @author      Jouanneau Laurent 
    66* @contributor 
     
    2323                $this->assertTrue($valid,  ' test de jSelectorZone('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.')'); 
    2424            }catch(jExceptionSelector $e){ 
    25                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     25                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    2626            }catch(Exception $e){ 
    2727                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
     
    4545                $this->assertTrue($valid,  ' test de jSelectorClass('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.','.$s->subpath.','.$s->className.')'); 
    4646            }catch(jExceptionSelector $e){ 
    47                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     47                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    4848            }catch(Exception $e){ 
    4949                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
     
    102102                $this->assertTrue($valid,  ' test de jSelectorInterface('.$sel. ') : contient ces données inattendues ('.$s->module.', '.$s->resource.','.$s->subpath.','.$s->className.')'); 
    103103            }catch(jExceptionSelector $e){ 
    104                 $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocalKey().')'); 
     104                $this->fail( 'jExceptionSelector inattendue sur test de '.$sel. ' : '.$e->getMessage().' ('.$e->getLocaleKey().')'); 
    105105            }catch(Exception $e){ 
    106106                $this->fail( 'exception inattendue sur test de '.$sel. ' : '.$e->getMessage()); 
  • trunk/testapp/var/config/defaultconfig.ini.php.dist

    r451 r462  
    2222 
    2323defaultTheme = default 
     24 
     25; for junittests module 
     26enableTests = on 
     27 
    2428 
    2529[plugins] 
  • trunk/testapp/var/config/defaultconfig.ini.php.dist

    r451 r462  
    2222 
    2323defaultTheme = default 
     24 
     25; for junittests module 
     26enableTests = on 
     27 
    2428 
    2529[plugins] 
Download in other formats: Unified Diff Zip Archive