diff options
Diffstat (limited to 'server/Test')
| -rwxr-xr-x | server/Test/AppTestClass.php | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/server/Test/AppTestClass.php b/server/Test/AppTestClass.php index 311b9bf..2babed4 100755 --- a/server/Test/AppTestClass.php +++ b/server/Test/AppTestClass.php @@ -6,6 +6,7 @@ class AppTest{ protected $openstack;
protected $pluginsApi;
+ protected $postParams;
protected $tokenClass;
protected $tokenPost;
protected $output;
@@ -15,8 +16,10 @@ class AppTest{ $this->tokenPost = NULL;
$this->tokenClass = new genTokenOptions($args);
$this->openstack = new OpenStack\OpenStack([]);
- $this->pluginsApi = plugin_api::getInstance();
+ $this->pluginsApi = plugin_api::getInstance(); + $this->errorClass = new errorManagement($this);
$this->output = array();
+ $this->postParams = $_POST; }
@@ -40,6 +43,11 @@ class AppTest{ $opt = $this->tokenClass->getOptions($service);
return $this->openstack->imagesV2($opt);
break;
+ case "Network":
+ if($this->tokenPost == NULL) $this->tokenClass->genNetworkToken();
+ $opt = $this->tokenClass->getOptions($service);
+ return $this->openstack->networkingV2($opt);
+ break;
}
}
@@ -53,10 +61,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];
}
|
