Changeset 1647

Show
Ignore:
Timestamp:
06/23/08 23:34:06 (2 months ago)
Author:
mikey
Message:

remove possibility of configuring the name of the json-rpc-service.ini file
add configuration options within json-rpc-service.ini: namespace and generated source target directory
adjust phing generate-clients in release build files
one thing left todo: get rid of the projectcheck target

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/dist/config/json-rpc-service.ini

    r1361 r1647  
     1[config] 
     2namespace = "stubbles.json.proxy" 
     3genjsdir = "javascript/genjs" 
     4 
     5[classmap] 
    16MathService = "org::stubbles::examples::service::MathService" 
    27NameService = "org::stubbles::examples::service::RememberNameService" 
  • trunk/projects/dist/config/xml/config.xml

    r1534 r1647  
    33    xmlns:xj="http://xjconf.net/XJConf" 
    44    xmlns="http://stubbles.net/lang/registry"> 
    5   <config name="net.stubbles.language" value="en_EN" /> 
    6   <config name="net.stubbles.number.decimals" value="4" /> 
    7   <config name="net.stubbles.util.log.class" value="net::stubbles::util::log::stubBaseLogData" /> 
    8   <config name="net.stubbles.ipo.request.class" value="net::stubbles::ipo::request::stubWebRequest" /> 
    9   <config name="net.stubbles.ipo.session.class" value="net::stubbles::ipo::session::stubPHPSession" /> 
    10   <config name="net.stubbles.service.jsonrpc.configfile" value="json-rpc-service.ini" /> 
     5  <config name="net.stubbles.language" value="en_EN"/> 
     6  <config name="net.stubbles.number.decimals" value="4"/> 
     7  <config name="net.stubbles.util.log.class" value="net::stubbles::util::log::stubBaseLogData"/> 
     8  <config name="net.stubbles.ipo.request.class" value="net::stubbles::ipo::request::stubWebRequest"/> 
     9  <config name="net.stubbles.ipo.session.class" value="net::stubbles::ipo::session::stubPHPSession"/> 
    1110</xj:configuration> 
  • trunk/projects/examples/config/json-rpc-service.ini

    r1361 r1647  
     1[config] 
     2namespace = "stubbles.json.proxy" 
     3genjsdir = "javascript/genjs" 
     4 
     5[classmap] 
    16MathService = "org::stubbles::examples::service::MathService" 
    27NameService = "org::stubbles::examples::service::RememberNameService" 
  • trunk/projects/examples/config/xml/config.xml

    r1534 r1647  
    33    xmlns:xj="http://xjconf.net/XJConf" 
    44    xmlns="http://stubbles.net/lang/registry"> 
    5   <config name="net.stubbles.mode" value="test" /> 
    6   <config name="net.stubbles.language" value="en_EN" /> 
    7   <config name="net.stubbles.number.decimals" value="4" /> 
    8   <config name="net.stubbles.util.log.class" value="net::stubbles::util::log::stubBaseLogData" /> 
    9   <config name="net.stubbles.ipo.request.class" value="net::stubbles::ipo::request::stubWebRequest" /> 
    10   <config name="net.stubbles.ipo.session.class" value="net::stubbles::ipo::session::stubPHPSession" /> 
    11   <config name="net.stubbles.service.jsonrpc.configfile" value="json-rpc-service.ini" /> 
     5  <config name="net.stubbles.language" value="en_EN"/> 
     6  <config name="net.stubbles.number.decimals" value="4"/> 
     7  <config name="net.stubbles.util.log.class" value="net::stubbles::util::log::stubBaseLogData"/> 
     8  <config name="net.stubbles.ipo.request.class" value="net::stubbles::ipo::request::stubWebRequest"/> 
     9  <config name="net.stubbles.ipo.session.class" value="net::stubbles::ipo::session::stubPHPSession"/> 
    1210</xj:configuration> 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessor.php

    r1544 r1647  
    2222{ 
    2323    /** 
    24      * registry key for the service config file 
    25      */ 
    26     const KEY_SERVICE_FILE = 'net.stubbles.service.jsonrpc.configfile'; 
    27     /** 
    2824     * configuration file with list of client classes 
    2925     * 
     
    3733    protected function doConstruct() 
    3834    { 
    39         $this->configFile = stubConfig::getConfigPath() . DIRECTORY_SEPARATOR . stubRegistry::getConfig(self::KEY_SERVICE_FILE, 'json-rpc-service.ini')
     35        $this->configFile = stubConfig::getConfigPath() . DIRECTORY_SEPARATOR . 'json-rpc-service.ini'
    4036    } 
    4137 
     
    5450         
    5551        $subProcessor = new $nqClassName(); 
    56         $subProcessor->process($this->request, $this->session, $this->response, $this->loadClassMap()); 
     52        $config       = $this->loadConfig(); 
     53        $subProcessor->process($this->request, $this->session, $this->response, $config['classmap'], $config['config']); 
    5754    } 
    5855 
     
    6360     * @throws  stubFileNotFoundException 
    6461     */ 
    65     protected function loadClassMap() 
     62    protected function loadConfig() 
    6663    { 
    6764        if (file_exists($this->configFile) === false || is_readable($this->configFile) === false) { 
     
    7067        } 
    7168         
    72         return parse_ini_file($this->configFile); 
     69        return parse_ini_file($this->configFile, true); 
    7370    } 
    7471 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcAbstractGenerateSubProcessor.php

    r1547 r1647  
    2121abstract class stubJsonRpcAbstractGenerateSubProcessor extends stubBaseObject implements stubJsonRpcSubProcessor 
    2222{ 
     23    /** 
     24     * default javascript namespace 
     25     * 
     26     * @var  string 
     27     */ 
     28    protected $jsNamespace = 'stubbles.json.proxy'; 
     29 
    2330    /** 
    2431     * helper method to detect the service url 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateProxiesSubProcessor.php

    r1547 r1647  
    2323{ 
    2424    /** 
    25      * default javascript namespace 
    26      * 
    27      * @var  string 
    28      */ 
    29     protected $jsNamespace = 'stubbles.json.proxy'; 
    30  
    31     /** 
    3225     * does the processing of the subtask 
    3326     * 
     
    3629     * @param  stubResponse                        $response  the current response 
    3730     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     31     * @param  array<string,string>                $config    json-rpc config 
    3832     */ 
    39     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     33    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    4034    { 
     35        if (isset($config['namespace']) === false) { 
     36            $config['namespace'] = $this->jsNamespace; 
     37        } 
     38         
    4139        $classes = $request->getValidatedValue(new stubRegexValidator('/^[A-Za-z,0-9_\.]+$/'), '__generateProxy'); 
    4240        if ('__all' !== $classes) { 
     
    4442        } 
    4543             
    46         $response->write($this->jsNamespace . " = {};\n\n"); 
     44        $response->write($config['namespace'] . " = {};\n\n"); 
    4745        $generator = $this->getProxyGenerator(); 
    4846        foreach ($classMap as $jsClass => $fqClassName) { 
    4947            if (is_array($classes) === false || in_array($jsClass, $classes) === true) { 
    5048                try { 
    51                     $response->write($generator->generateJavascriptProxy($fqClassName, $jsClass)); 
     49                    $response->write($generator->generateJavascriptProxy($fqClassName, $jsClass, $config['namespace'])); 
    5250                } catch (Exception $e) { 
    5351                    $this->handleException($e, $response, 'Generation of proxy for ' . $fqClassName . ' failed.'); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateSmdSubProcessor.php

    r1547 r1647  
    2626     * @param  stubResponse                        $response  the current response 
    2727     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     28     * @param  array<string,string>                $config    json-rpc config 
    2829     */ 
    29     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     30    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    3031    { 
     32        if (isset($config['namespace']) === false) { 
     33            $config['namespace'] = $this->jsNamespace; 
     34        } 
     35         
    3136        $class     = $request->getValidatedValue(new stubRegexValidator('/^[A-Za-z0-9_\.]+$/'), '__smd'); 
    3237        $generator = $this->getSmdGenerator($this->getServiceURL($request) . '&__class=' . $class); 
    3338        // get rid of namespace for class matching 
    34         $class     = preg_replace('/stubbles\.json\.proxy\./', '', $class); 
     39        $class     = preg_replace('/' . preg_quote($config['namespace']) . '\./', '', $class); 
    3540        try { 
    3641            $response->write($generator->generateSmd($classMap[$class], $class)); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGetSubProcessor.php

    r1547 r1647  
    4747     * @param  stubResponse                        $response  the current response 
    4848     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     49     * @param  array<string,string>                $config    json-rpc config 
    4950     */ 
    50     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     51    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    5152    { 
    5253        $requestId = $request->getValidatedValue(new stubRegexValidator(self::ID_PATTERN), 'id'); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcPostSubProcessor.php

    r1547 r1647  
    2929     * @param  stubResponse                        $response  the current response 
    3030     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     31     * @param  array<string,string>                $config    json-rpc config 
    3132     */ 
    32     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     33    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    3334    { 
    3435        $requestJsonObj = $request->getValidatedRawData(new stubPassThruValidator()); 
  • trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcSubProcessor.php

    r1434 r1647  
    2626     * @param  stubResponse                        $response  the current response 
    2727     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     28     * @param  array<string,string>                $config    json-rpc config 
    2829     */ 
    29     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap); 
     30    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config); 
    3031} 
    3132?> 
  • trunk/src/main/php/org/stubbles/phing/tasks/stubGenerateJsonRpcProxiesTask.php

    r1646 r1647  
    2424     * Target folder of the generated proxy files 
    2525     * 
    26      * @var string 
     26     * @var string 
    2727     */ 
    28     protected $targetFolder; 
    29  
     28    protected  $docroot; 
    3029    /** 
    3130     * File containing the service definitions 
    3231     * 
    33      * @var string 
     32     * @var string 
    3433     */ 
    3534    protected $serviceFile; 
    36      
    3735    /** 
    3836     * Namespace for the generated javascript code 
    3937     * 
    40      * @var string 
     38     * @var string 
    4139     */ 
    4240    protected $javaScriptNamespace = 'stubbles.json.proxy'; 
     41    /** 
     42     * default target dir within docroot 
     43     * 
     44     * @var  string 
     45     */ 
     46    protected $genJsDir            = 'javascript/genjs'; 
    4347 
    4448    /** 
    4549     * Set the target folder for the generated proxies 
    4650     * 
    47      * @param string $targetFolder 
     51     * @param string  $docroot 
    4852     */ 
    49     public function setTargetFolder($targetFolder
     53    public function setDocroot($docroot
    5054    { 
    51         $this->targetFolder = $targetFolder
     55        $this->docroot = $docroot
    5256    } 
    5357 
     
    6064    { 
    6165        $this->serviceFile = $serviceFile; 
    62     } 
    63      
    64     /** 
    65      * Set the namespace for the generated javascript code 
    66      * (keeping the gloabl js namespace clean) 
    67      * 
    68      * @param string $namespace 
    69      */ 
    70     public function setJavaScriptNamespace($namespace) 
    71     { 
    72         $this->javaScriptNamespace = $namespace; 
    7366    } 
    7467 
     
    8780    { 
    8881        stubClassLoader::load('net::stubbles::service::jsonrpc::util::stubJsonRpcProxyGenerator'); 
    89         $services   = parse_ini_file($this->serviceFile); 
     82        $services   = parse_ini_file($this->serviceFile, true); 
    9083        $generator  = new stubJsonRpcProxyGenerator(); 
    91         $fullJsCode = "{$this->javaScriptNamespace} = {};\n\n"; 
    92         foreach ($services as $class => $fqClassName) { 
     84        if (isset($services['config']['namespace']) === false) { 
     85            $services['config']['namespace'] = $this->javaScriptNamespace; 
     86        } 
     87         
     88        if (isset($services['config']['genjsdir']) === false) { 
     89            $services['config']['genjsdir'] = $this->genJsDir; 
     90        } 
     91         
     92        if (file_exists($this->docroot . '/' . $services['config']['genjsdir']) === false) { 
     93            mkdir($this->docroot . '/' . $services['config']['genjsdir'], null, true); 
     94        } 
     95         
     96        $fullJsCode = $services['config']['namespace'] . " = {};\n\n"; 
     97        foreach ($services['classmap'] as $class => $fqClassName) { 
    9398            try { 
    94                 $jsCode = $generator->generateJavascriptProxy($fqClassName, $class, $this->javaScriptNamespace); 
     99                $jsCode = $generator->generateJavascriptProxy($fqClassName, $class, $services['config']['namespace']); 
    95100            } catch (stubClassNotFoundException $e) { 
    96101                $this->log("Cannot generate proxy for {$fqClassName}, class does not exist.", Project::MSG_ERR); 
     
    98103            } 
    99104             
    100             $targetFile = $this->targetFolder . '/' . $class . '.js'; 
     105            $targetFile = $this->docroot . '/' . $services['config']['genjsdir'] . '/' . $class . '.js'; 
    101106            if (@file_put_contents($targetFile, $jsCode)) {; 
    102107                $this->log("Wrote proxy for {$fqClassName} to {$targetFile}."); 
     
    113118        } 
    114119         
    115         $targetFile = $this->targetFolder . '/allClients.js'; 
     120        $targetFile = $this->docroot . '/' . $services['config']['genjsdir'] . '/allClients.js'; 
    116121        if (@file_put_contents($targetFile, $fullJsCode)) {; 
    117122            $this->log("Wrote proxy for all classes to {$targetFile}."); 
  • trunk/src/main/resources/phing/build-stubbles.xml

    r1646 r1647  
    187187        <mkdir dir="${stubbles.projects.path}/${stubbles.project}/docroot/${jsonrpc.clients.dir}"/> 
    188188        <stubGenerateJsonRpcProxies serviceFile="${stubbles.projects.path}/${stubbles.project}/config/json-rpc-service.ini" 
    189                                     targetFolder="${stubbles.projects.path}/${stubbles.project}/docroot/${jsonrpc.clients.dir}"/> 
     189                                    docroot="${stubbles.projects.path}/${stubbles.project}/docroot"/> 
    190190      </then> 
    191191      <else> 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessorTestCase.php

    r1443 r1647  
    3333 
    3434    /** 
    35      * access to protected class map loading 
     35     * access to protected config loading 
    3636     * 
    3737     * @return  array<string,string> 
    3838     */ 
    39     public function callLoadClassMap() 
    40     { 
    41         return $this->loadClassMap(); 
     39    public function callLoadConfig() 
     40    { 
     41        return $this->loadConfig(); 
    4242    } 
    4343 
     
    9898        $subProcessorClass = get_class($this->getMock('stubJsonRpcSubProcessor')); 
    9999        $jsonRpcProcessor  = $this->getMock('stubJsonRpcProcessor', 
    100                                             array('loadClassMap', 
     100                                            array('loadConfig', 
    101101                                                  'getSubProcessorClassName' 
    102102                                            ), 
     
    107107                             ); 
    108108        $jsonRpcProcessor->expects($this->once())->method('getSubProcessorClassName')->will($this->returnValue($subProcessorClass)); 
    109         $jsonRpcProcessor->expects($this->once())->method('loadClassMap')->will($this->returnValue(array())); 
     109        $jsonRpcProcessor->expects($this->once()) 
     110                         ->method('loadConfig') 
     111                         ->will($this->returnValue(array('config'   => array('namespace' => 'foo'), 
     112                                                         'classmap' => array() 
     113                                                   ) 
     114                                ) 
     115                           ); 
    110116        $jsonRpcProcessor->process(); 
    111117    } 
     
    130136                                ); 
    131137        $jsonRpcProcessor->setConfigFile(vfsStream::url('config/doesNotExist.ini')); 
    132         $jsonRpcProcessor->callLoadClassMap(); 
    133     } 
    134  
    135     /** 
    136      * loading the class map should return a list of classes 
    137      * 
    138      * @test 
    139      */ 
    140     public function loadClassMap() 
     138        $jsonRpcProcessor->callLoadConfig(); 
     139    } 
     140 
     141    /** 
     142     * loading the config 
     143     * 
     144     * @test 
     145     */ 
     146    public function loadConfig() 
    141147    { 
    142148        if (class_exists('vfsStream', false) === false) { 
     
    146152        vfsStreamWrapper::register(); 
    147153        vfsStreamWrapper::setRoot(new vfsStreamDirectory('config')); 
    148         vfsStream::newFile('json-rpc-service.ini.ini')->at(vfsStreamWrapper::getRoot())->withContent("MathService = \"org::stubbles::examples::service::MathService\"\nNameService = \"org::stubbles::examples::service::RememberNameService\""); 
     154        vfsStream::newFile('json-rpc-service.ini.ini')->at(vfsStreamWrapper::getRoot())->withContent("[config]\nnamespace = \"stubbles.json.proxy\"\ngenjsdir = \"javascript/genjs\"\n[classmap]\nMathService = \"org::stubbles::examples::service::MathService\"\nNameService = \"org::stubbles::examples::service::RememberNameService\""); 
    149155        $jsonRpcProcessor = new TeststubJsonRpcProcessor($this->mockRequest, 
    150156                                                         $this->mockSession, 
     
    152158                                ); 
    153159        $jsonRpcProcessor->setConfigFile(vfsStream::url('config/json-rpc-service.ini.ini')); 
    154         $this->assertEquals(array('MathService' => 'org::stubbles::examples::service::MathService', 
    155                                   'NameService' => 'org::stubbles::examples::service::RememberNameService' 
     160        $this->assertEquals(array('config'   => array('namespace' => 'stubbles.json.proxy', 
     161                                                      'genjsdir'  => 'javascript/genjs' 
     162                                                ), 
     163                                  'classmap' => array('MathService' => 'org::stubbles::examples::service::MathService', 
     164                                                      'NameService' => 'org::stubbles::examples::service::RememberNameService' 
     165                                                ) 
    156166                            ), 
    157                             $jsonRpcProcessor->callLoadClassMap() 
     167                            $jsonRpcProcessor->callLoadConfig() 
    158168        ); 
    159169    } 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcAbstractGenerateSubProcessorTestCase.php

    r1434 r1647  
    2323     * @param  stubResponse                        $response  the current response 
    2424     * @param  array<string,array<string,string>>  $classMap  list of available webservice classes 
     25     * @param  array<string,string>                $config    json-rpc config 
    2526     */ 
    26     public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap
     27    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $classMap, array $config
    2728    { 
    2829        // intentionally empty 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateProxiesSubProcessorTestCase.php

    r1434 r1647  
    9191        $this->jsonRpcGenerateProxiesSubProcessor->expects($this->never()) 
    9292                                                 ->method('handleException'); 
    93         $this->jsonRpcGenerateProxiesSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap); 
     93        $this->jsonRpcGenerateProxiesSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array()); 
     94    } 
     95 
     96    /** 
     97     * retrieve service url 
     98     * 
     99     * @test 
     100     */ 
     101    public function successfulWithConfiguredNamespace() 
     102    { 
     103        $this->mockRequest->expects($this->once())->method('getValidatedValue')->will($this->returnValue('__all')); 
     104        $this->jsonRpcGenerateProxiesSubProcessor->expects($this->never())->method('getServiceURL'); 
     105        $this->mockProxyGenerator = $this->getMock('stubJsonRpcProxyGenerator'); 
     106        $this->mockProxyGenerator->expects($this->at(0)) 
     107                                 ->method('generateJavascriptProxy') 
     108                                 ->with($this->equalTo('TestService'), $this->equalTo('Test')) 
     109                                 ->will($this->returnValue('javascript proxy1')); 
     110        $this->mockProxyGenerator->expects($this->at(1)) 
     111                                 ->method('generateJavascriptProxy') 
     112                                 ->with($this->equalTo('DoesNotExist'), $this->equalTo('Nope')) 
     113                                 ->will($this->returnValue('javascript proxy2')); 
     114        $this->jsonRpcGenerateProxiesSubProcessor->expects($this->once()) 
     115                                                 ->method('getProxyGenerator') 
     116                                                 ->will($this->returnValue($this->mockProxyGenerator)); 
     117        $this->mockResponse->expects($this->at(0))->method('write')->with($this->equalTo("foo.bar = {};\n\n")); 
     118        $this->mockResponse->expects($this->at(1))->method('write')->with($this->equalTo('javascript proxy1')); 
     119        $this->mockResponse->expects($this->at(2))->method('write')->with($this->equalTo('javascript proxy2')); 
     120        $this->jsonRpcGenerateProxiesSubProcessor->expects($this->never()) 
     121                                                 ->method('handleException'); 
     122        $this->jsonRpcGenerateProxiesSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array('namespace' => 'foo.bar')); 
    94123    } 
    95124 
     
    115144                                                 ->method('handleException') 
    116145                                                 ->with($this->equalTo($exception, $this->mockResponse, 'Generation of proxy for TestService failed.')); 
    117         $this->jsonRpcGenerateProxiesSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap); 
     146        $this->jsonRpcGenerateProxiesSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array()); 
    118147    } 
    119148} 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGenerateSmdSubProcessorTestCase.php

    r1434 r1647  
    8989        $this->jsonRpcGenerateSmdSubProcessor->expects($this->never()) 
    9090                                             ->method('handleException'); 
    91         $this->jsonRpcGenerateSmdSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap); 
     91        $this->jsonRpcGenerateSmdSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array()); 
     92    } 
     93 
     94    /** 
     95     * retrieve service url 
     96     * 
     97     * @test 
     98     */ 
     99    public function successfulWithConfiguredNamespace() 
     100    { 
     101        $this->mockRequest->expects($this->once())->method('getValidatedValue')->will($this->returnValue('foo.bar.Test')); 
     102        $this->jsonRpcGenerateSmdSubProcessor->expects($this->once()) 
     103                                             ->method('getServiceURL') 
     104                                             ->with($this->equalTo($this->mockRequest)) 
     105                                             ->will($this->returnValue('serviceUrl')); 
     106        $this->mockSmdGenerator = $this->getMock('stubSmdGenerator', array(), array('serviceUrl')); 
     107        $this->mockSmdGenerator->expects($this->once()) 
     108                               ->method('generateSmd') 
     109                               ->with($this->equalTo('TestService'), $this->equalTo('Test')) 
     110                               ->will($this->returnValue('smdDescription')); 
     111        $this->jsonRpcGenerateSmdSubProcessor->expects($this->once()) 
     112                                             ->method('getSmdGenerator') 
     113                                             ->with($this->equalTo('serviceUrl&__class=foo.bar.Test')) 
     114                                             ->will($this->returnValue($this->mockSmdGenerator)); 
     115        $this->mockResponse->expects($this->once())->method('write')->with($this->equalTo('smdDescription')); 
     116        $this->jsonRpcGenerateSmdSubProcessor->expects($this->never()) 
     117                                             ->method('handleException'); 
     118        $this->jsonRpcGenerateSmdSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array('namespace' => 'foo.bar')); 
    92119    } 
    93120 
     
    118145                                             ->method('handleException') 
    119146                                             ->with($this->equalTo($exception, $this->mockResponse, 'Generation of SMD for TestService failed.')); 
    120         $this->jsonRpcGenerateSmdSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap); 
     147        $this->jsonRpcGenerateSmdSubProcessor->process($this->mockRequest, $this->mockSession, $this->mockResponse, $this->classMap, array()); 
    121148    } 
    122149} 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcGetSubProcessorTestCase.php

    r1434 r1647  
    8484                                               $this->mockSession, 
    8585                                               $this->mockResponse, 
    86                                                $this->classMap 
     86                                               $this->classMap, 
     87                                               array() 
    8788        ); 
    8889    } 
     
    100101                                               $this->mockSession, 
    101102                                               $this->mockResponse, 
    102                                                $this->classMap 
     103                                               $this->classMap, 
     104                                               array() 
    103105        ); 
    104106    } 
     
    116118                                               $this->mockSession, 
    117119                                               $this->mockResponse, 
    118                                                $this->classMap 
     120                                               $this->classMap, 
     121                                               array() 
    119122        ); 
    120123    } 
     
    132135                                               $this->mockSession, 
    133136                                               $this->mockResponse, 
    134                                                $this->classMap 
     137                                               $this->classMap, 
     138                                               array() 
    135139        ); 
    136140    } 
     
    148152                                               $this->mockSession, 
    149153                                               $this->mockResponse, 
    150                                                $this->classMap 
     154                                               $this->classMap, 
     155                                               array() 
    151156        ); 
    152157    } 
     
    164169                                               $this->mockSession, 
    165170                                               $this->mockResponse, 
    166                                                $this->classMap 
     171                                               $this->classMap, 
     172                                               array() 
    167173        ); 
    168174    } 
     
    180186                                               $this->mockSession, 
    181187                                               $this->mockResponse, 
    182                                                $this->classMap 
     188                                               $this->classMap, 
     189                                               array() 
    183190        ); 
    184191    } 
     
    196203                                               $this->mockSession, 
    197204                                               $this->mockResponse, 
    198                                                $this->classMap 
     205                                               $this->classMap, 
     206                                               array() 
    199207        ); 
    200208    } 
     
    212220                                               $this->mockSession, 
    213221                                               $this->mockResponse, 
    214                                                $this->classMap 
     222                                               $this->classMap, 
     223                                               array() 
    215224        ); 
    216225    } 
     
    229238                                               $this->mockSession, 
    230239                                               $this->mockResponse, 
    231                                                $this->classMap 
     240                                               $this->classMap, 
     241                                               array() 
    232242        ); 
    233243    } 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcPostSubProcessorTestCase.php

    r1434 r1647  
    8484                                                $this->mockSession, 
    8585                                                $this->mockResponse, 
    86                                                 $this->classMap 
     86                                                $this->classMap, 
     87                                               array() 
    8788        ); 
    8889    } 
     
    100101                                                $this->mockSession, 
    101102                                                $this->mockResponse, 
    102                                                 $this->classMap 
     103                                                $this->classMap, 
     104                                               array() 
    103105        ); 
    104106    } 
     
    116118                                                $this->mockSession, 
    117119                                                $this->mockResponse, 
    118                                                 $this->classMap 
     120                                                $this->classMap, 
     121                                               array() 
    119122        ); 
    120123    } 
     
    132135                                                $this->mockSession, 
    133136                                                $this->mockResponse, 
    134                                                 $this->classMap 
     137                                                $this->classMap, 
     138                                               array() 
    135139        ); 
    136140    } 
     
    148152                                                $this->mockSession, 
    149153                                                $this->mockResponse, 
    150                                                 $this->classMap 
     154                                                $this->classMap, 
     155                                               array() 
    151156        ); 
    152157    } 
     
    164169                                                $this->mockSession, 
    165170                                                $this->mockResponse, 
    166                                                 $this->classMap 
     171                                                $this->classMap, 
     172                                               array() 
    167173        ); 
    168174    } 
     
    180186                                                $this->mockSession, 
    181187                                                $this->mockResponse, 
    182                                                 $this->classMap 
     188                                                $this->classMap, 
     189                                               array() 
    183190        ); 
    184191    } 
     
    196203                                        &nb