diff options
Diffstat (limited to 'server/Test/AppTestClass.php')
| -rwxr-xr-x | server/Test/AppTestClass.php | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/server/Test/AppTestClass.php b/server/Test/AppTestClass.php index 40a5847..3ff0aea 100755 --- a/server/Test/AppTestClass.php +++ b/server/Test/AppTestClass.php @@ -12,6 +12,7 @@ class AppTest{ protected $openstack;
protected $pluginsApi;
+ protected $postParams;
protected $tokenClass;
protected $tokenPost;
protected $output;
@@ -23,8 +24,13 @@ class AppTest{ $this->tokenClass = new genTokenOptions($args);
$this->openstack = new OpenStack\OpenStack([]);
$this->pluginsApi = plugin_api::getInstance();
+ $this->errorClass = new errorManagement($this);
$this->output = array();
+<<<<<<< HEAD $this->errorClass = new errorManagement($this);
+======= + $this->postParams = $_POST;
+>>>>>>> develop }
@@ -48,6 +54,16 @@ class AppTest{ $opt = $this->tokenClass->getOptions($service);
return $this->openstack->imagesV2($opt);
break;
+ case "Compute":
+ if($this->tokenPost == NULL) $this->tokenClass->genComputeToken();
+ $opt = $this->tokenClass->getOptions($service);
+ return $this->openstack->computeV2($opt);
+ break;
+ case "Network":
+ if($this->tokenPost == NULL) $this->tokenClass->genNetworkToken();
+ $opt = $this->tokenClass->getOptions($service);
+ return $this->openstack->networkingV2($opt);
+ break;
}
}
@@ -61,10 +77,21 @@ class AppTest{ $this->tokenClass->genNetworkToken();
$this->setOutput("token", $this->tokenClass->getBackup());
- }catch(Exception $e){
- echo $e;
- exit();
- }
+ }catch(BadResponseError $e){
+ $this->errorClass->BadResponseHandler($e);
+ }catch(UserInputError $e){
+ $this->errorClass->UserInputHandler($e);
+ }catch(BaseError $e){
+ $this->errorClass->BaseErrorHandler($e);
+ }catch(NotImplementedError $e){
+ $this->errorClass->NotImplementedHandler($e);
+ }
+
+ }
+
+ public function getPostParam($name){
+
+ return $this->postParams[$name];
}
@@ -75,12 +102,16 @@ class AppTest{ }
public function show(){
- echo json_encode($this->output);
+ return json_encode($this->output);
}
+<<<<<<< HEAD public function getErrorInstance(){
return $this->errorClass;
}
-}
\ No newline at end of file +} +======= +}
+>>>>>>> develop |
