/[volute]/trunk/projects/grid/vospace/php_endpoint/tests/test_service.php
ViewVC logotype

Annotation of /trunk/projects/grid/vospace/php_endpoint/tests/test_service.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 738 - (hide annotations)
Thu Aug 21 21:45:51 2008 UTC (13 years, 1 month ago) by richard.p.wagner
File size: 1727 byte(s)
added simple authorization mechanism
1 richard.p.wagner 106 <?php
2    
3     include('../config.inc');
4    
5     require_once(SIMPLE_TEST . 'unit_tester.php');
6     require_once(SIMPLE_TEST . 'reporter.php');
7    
8     require_once('../vospace_service.php');
9    
10 richard.p.wagner 731 require_once('debug_funcs.php');
11    
12     class target_node{
13     public $target;
14     function __construct($tg) {
15     $this->target = $tg;
16     }
17     }
18    
19 richard.p.wagner 106 class TestVOSpaceService extends UnitTestCase {
20 richard.p.wagner 731 function setUp() {
21 richard.p.wagner 106 $this->vospace_server = new SoapServer('../vospace.wsdl',
22     array('uri' => 'http://www.ivoa.net/xml/VOSpaceContract-v1.1rc1'));
23     $this->vospace_server->SetClass("VOSpaceService");
24    
25     $this->service = new VOSpaceService();
26    
27     }
28    
29     function testNewServer() {
30     $this->assertNotNull($this->vospace_server);
31     }
32    
33     function testFunctionsList() {
34    
35     $function_list = $this->vospace_server->getFunctions();
36    
37     $this->assertNotNull($function_list);
38     $this->assertTrue(in_array("ListNodes", $function_list));
39 richard.p.wagner 738 // includes Security
40     $this->assertEqual(count($function_list), 17);
41 richard.p.wagner 106 }
42    
43     function testProperties() {
44    
45     $prop_list = $this->service->GetProperties();
46    
47 richard.p.wagner 731 //barf_var($prop_list);
48    
49 richard.p.wagner 106 $this->assertNotNull($prop_list);
50    
51 richard.p.wagner 731 $size = $prop_list["provides"][0];
52 richard.p.wagner 106
53     // properties are of a class Property
54 richard.p.wagner 731 $this->assertNotNull($size);
55     $this->assertEqual($size["uri"], "ivo://net.ivoa.vospace/properties#size");
56 richard.p.wagner 734 $this->assertEqual($size["readonly"], TRUE);
57 richard.p.wagner 106 }
58    
59 richard.p.wagner 731 function testGetNode() {
60    
61     $node = $this->service->GetNode(new target_node('ivo://example.org!vospace/128cubed_hierarchy.png'));
62    
63     //barf_var($node);
64    
65     $this->assertNotNull($node["node"]);
66     $this->assertEqual($node["node"]->properties[0]["_"], 569516);
67     }
68    
69 richard.p.wagner 106 }
70    
71    
72     $test = &new TestVOSpaceService();
73     $test->run(new HtmlReporter());
74    
75     ?>

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26