From 3eb8f30b12b1439e9ce23a338699b31165dfc346 Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Wed, 16 Sep 2009 15:51:55 -0400 Subject: [PATCH] started on deleteApplication --- hqu/hqapi1/app/ApplicationController.groovy | 14 ++++++++++++++ .../hq/hqapi1/test/ApplicationList_test.java | 9 +++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/hqu/hqapi1/app/ApplicationController.groovy b/hqu/hqapi1/app/ApplicationController.groovy index 92dcc6cd..622ebc04 100644 --- a/hqu/hqapi1/app/ApplicationController.groovy +++ b/hqu/hqapi1/app/ApplicationController.groovy @@ -80,8 +80,22 @@ class ApplicationController extends ApiController { } def delete(params) { + def id = params.getOne('id')?.toInteger() + + if (id == null) { + renderXml() { + out << StatusResponse() { + out << getFailureXML(ErrorCode.INVALID_PARAMETERS) + } + } + return + } + def failureXml = null + // TODO: remove next debugging line + print "ID: " + id + renderXml() { StatusResponse() { if (failureXml) { diff --git a/src/org/hyperic/hq/hqapi1/test/ApplicationList_test.java b/src/org/hyperic/hq/hqapi1/test/ApplicationList_test.java index 4ba4bf40..95291c8b 100644 --- a/src/org/hyperic/hq/hqapi1/test/ApplicationList_test.java +++ b/src/org/hyperic/hq/hqapi1/test/ApplicationList_test.java @@ -17,11 +17,12 @@ public void testList() throws Exception { ApplicationsResponse response = api.listApplications(); // TODO: remove debugging lines System.out.println("TEST " + response); - System.out.println("TEST " + response.getApplication().size()); + System.out.println("TEST - Apps: " + response.getApplication().size()); if (response.getApplication().size() > 0) { - System.out.println("TEST " + response.getApplication().get(0).getLocation()); - System.out.println("TEST " + response.getApplication().get(0).getDescription()); - System.out.println("Resources: " + response.getApplication().get(0).getApplicationServices()); + System.out.println("APP 1: " + response.getApplication().get(0).getId()); + System.out.println("APP 1: " + response.getApplication().get(0).getLocation()); + System.out.println("APP 1: " + response.getApplication().get(0).getDescription()); + System.out.println("APP 1 Resources: " + response.getApplication().get(0).getApplicationServices()); } hqAssertSuccess(response); }