You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/05/20 12:08:49 UTC

[2/3] stratos git commit: Fixed issues found when deploying a non existing application

Fixed issues found when deploying a non existing application


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3c09660e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3c09660e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3c09660e

Branch: refs/heads/master
Commit: 3c09660e99dec176a386157f14ca899bd896e9a6
Parents: b5b6eed
Author: Dinithi <di...@wso2.com>
Authored: Wed May 20 11:05:50 2015 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Wed May 20 15:38:41 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java   | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3c09660e/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index edca089..d430572 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -1525,18 +1525,11 @@ public class RestCommandLineService {
             HttpResponse response = restClient.doPost(httpClient, restClient.getBaseURL()
                     + url, "");
 
-            String responseCode = "" + response.getStatusLine().getStatusCode();
+            String result = getHttpResponseString(response);
 
             GsonBuilder gsonBuilder = new GsonBuilder();
             Gson gson = gsonBuilder.create();
-
-            if (Integer.parseInt(responseCode) < 300 && Integer.parseInt(responseCode) >= 200) {
-                System.out.println("You have successfully deployed application: " + applicationId);
-            } else {
-                String resultString = CliUtils.getHttpResponseString(response);
-                ExceptionMapper exception = gson.fromJson(resultString, ExceptionMapper.class);
-                System.out.println(exception);
-            }
+            System.out.println(gson.fromJson(result, ResponseMessageBean.class).getMessage());
 
         } catch (Exception e) {
             String message = "Could not deploy application: " + applicationId;