Commit b9c5d84e7e92917ce23676caeb9647477c299a5f
1 parent
39bae1d7
Exists in
master
and in
95 other branches
Add test for getPlot API
Showing
2 changed files
with
70 additions
and
1 deletions
Show diff stats
... | ... | @@ -0,0 +1,69 @@ |
1 | +<?php | |
2 | + | |
3 | +require_once "Base/TestAbstract.php"; | |
4 | + | |
5 | +class TestGetPlot_50 extends TestAbstract | |
6 | +{ | |
7 | + public function getAPI() { | |
8 | + return "getPlot"; | |
9 | + } | |
10 | + | |
11 | + public function getParams() { | |
12 | + return array( | |
13 | + "startTime" => "2008-01-01T00:00:00", | |
14 | + "stopTime" => "2008-01-02T00:00:00", | |
15 | + "missionID" => "ACE", | |
16 | + ); | |
17 | + } | |
18 | + | |
19 | + public function getDescription() { | |
20 | + return "Plot ACE data."; | |
21 | + } | |
22 | + | |
23 | + public function getWSTypes() { | |
24 | + return array("SOAP"); | |
25 | + } | |
26 | + | |
27 | + protected function checkRESTResult($result) { | |
28 | + return array( | |
29 | + 'success' => FALSE, | |
30 | + 'message' => 'Not implemented', | |
31 | + ); | |
32 | + } | |
33 | + | |
34 | + protected function checkSOAPResult($result) { | |
35 | + if (empty($result)) { | |
36 | + return array( | |
37 | + 'success' => FALSE, | |
38 | + 'message' => 'Empty result', | |
39 | + ); | |
40 | + } | |
41 | + | |
42 | + if (empty($result->success)) { | |
43 | + return array( | |
44 | + 'success' => FALSE, | |
45 | + 'message' => 'Error during plot request', | |
46 | + ); | |
47 | + } | |
48 | + | |
49 | + if ($result->status != 'done') { | |
50 | + return array( | |
51 | + 'success' => FALSE, | |
52 | + 'message' => 'Status is not done ('.$obj->status.')', | |
53 | + ); | |
54 | + } | |
55 | + | |
56 | + if (empty($result->plotFileURL)) { | |
57 | + return array( | |
58 | + 'success' => FALSE, | |
59 | + 'message' => 'Missing plot file URL in result', | |
60 | + ); | |
61 | + } | |
62 | + | |
63 | + return array( | |
64 | + 'success' => TRUE, | |
65 | + ); | |
66 | + } | |
67 | +} | |
68 | + | |
69 | +?> | |
... | ... |
php/classes/AmdaStats.php
... | ... | @@ -13,7 +13,7 @@ class AmdaStats { |
13 | 13 | public $success = true; |
14 | 14 | private $user = null; |
15 | 15 | private $task = array('request'=>'plot','condition'=>'mining', 'download'=>'print','statistics'=>'statistics', |
16 | - 'getparameter'=>'ws_print', 'getdataset' => 'ws_print', 'getorbites' => 'ws_print'); | |
16 | + 'getparameter'=>'ws_print', 'getdataset' => 'ws_print', 'getorbites' => 'ws_print', 'getplot' => 'ws_plot'); | |
17 | 17 | |
18 | 18 | public function __construct($user) { |
19 | 19 | |
... | ... |