From 865c79ac83ac4eed259e28476385110e845d1c98 Mon Sep 17 00:00:00 2001 From: Ryan Morgan Date: Wed, 18 Aug 2010 10:49:42 -0700 Subject: [PATCH] [HHQ-4149] First pass at getting WADL tests passing again. --- .../hq/hqapi1/test/WADLAgent_test.java | 6 +-- .../hqapi1/test/WADLAlertDefinition_test.java | 24 +++++------ .../hq/hqapi1/test/WADLAlert_test.java | 10 ++--- .../hq/hqapi1/test/WADLApplication_test.java | 36 ++++++++-------- .../hqapi1/test/WADLAutodiscovery_test.java | 8 ++-- .../hq/hqapi1/test/WADLControl_test.java | 12 +++--- .../hq/hqapi1/test/WADLEscalation_test.java | 14 +++---- .../hq/hqapi1/test/WADLEvent_test.java | 4 +- .../hq/hqapi1/test/WADLGroup_test.java | 10 ++--- .../hq/hqapi1/test/WADLMaintenance_test.java | 10 ++--- .../hq/hqapi1/test/WADLMetricData_test.java | 14 +++---- .../hq/hqapi1/test/WADLMetric_test.java | 28 ++++++------- .../hq/hqapi1/test/WADLResource_test.java | 30 +++++++------- .../hyperic/hq/hqapi1/test/WADLRole_test.java | 10 ++--- .../hq/hqapi1/test/WADLServerConfig_test.java | 14 +++---- .../hyperic/hq/hqapi1/test/WADLUser_test.java | 16 ++++---- hqapi1/pom.xml | 41 +++++++++++++++---- hqapi1/src/main/wadl/HQApi1.wadl | 2 +- 18 files changed, 156 insertions(+), 133 deletions(-) diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAgent_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAgent_test.java index a3005eba..b08962b5 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAgent_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAgent_test.java @@ -6,9 +6,9 @@ public class WADLAgent_test extends WADLTestBase { public void testAgent() throws Exception { - Endpoint.AgentGetHqu agentGet = new Endpoint.AgentGetHqu(); - Endpoint.AgentListHqu agentList = new Endpoint.AgentListHqu(); - Endpoint.AgentPingHqu agentPing = new Endpoint.AgentPingHqu(); + HttpLocalhost8080HquHqapi1.AgentGetHqu agentGet = new HttpLocalhost8080HquHqapi1.AgentGetHqu(); + HttpLocalhost8080HquHqapi1.AgentListHqu agentList = new HttpLocalhost8080HquHqapi1.AgentListHqu(); + HttpLocalhost8080HquHqapi1.AgentPingHqu agentPing = new HttpLocalhost8080HquHqapi1.AgentPingHqu(); AgentsResponse agents = agentList.getAsAgentsResponse(); hqAssertSuccess(agents); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlertDefinition_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlertDefinition_test.java index 3cb90c75..ff5b5089 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlertDefinition_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlertDefinition_test.java @@ -8,45 +8,45 @@ public class WADLAlertDefinition_test extends WADLTestBase { public void testListDefinitions() throws Exception { - Endpoint.AlertdefinitionListDefinitionsHqu adList = - new Endpoint.AlertdefinitionListDefinitionsHqu(); + HttpLocalhost8080HquHqapi1.AlertdefinitionListDefinitionsHqu adList = + new HttpLocalhost8080HquHqapi1.AlertdefinitionListDefinitionsHqu(); AlertDefinitionsResponse response = adList.getAsAlertDefinitionsResponse(); hqAssertSuccess(response); } public void testListDefinitionsByResources() throws Exception { - Endpoint.AlertdefinitionListDefinitionsByResourcesHqu adList = - new Endpoint.AlertdefinitionListDefinitionsByResourcesHqu(); + HttpLocalhost8080HquHqapi1.AlertdefinitionListDefinitionsByResourcesHqu adList = + new HttpLocalhost8080HquHqapi1.AlertdefinitionListDefinitionsByResourcesHqu(); List resources = new ArrayList(); ResourcesRequest request = new ResourcesRequest(); request.getResource().addAll(resources); - AlertDefinitionsResponse response = adList.postAsAlertDefinitionsResponse(request); + AlertDefinitionsResponse response = adList.postApplicationXmlAsAlertDefinitionsResponse(request); hqAssertSuccess(response); } public void testListTypeDefinitions() throws Exception { - Endpoint.AlertdefinitionListTypeDefinitionsHqu adTypeList = - new Endpoint.AlertdefinitionListTypeDefinitionsHqu(); + HttpLocalhost8080HquHqapi1.AlertdefinitionListTypeDefinitionsHqu adTypeList = + new HttpLocalhost8080HquHqapi1.AlertdefinitionListTypeDefinitionsHqu(); AlertDefinitionsResponse response = adTypeList.getAsAlertDefinitionsResponse(); hqAssertSuccess(response); } public void testDelete() throws Exception { - Endpoint.AlertdefinitionDeleteHqu adDelete = - new Endpoint.AlertdefinitionDeleteHqu(); + HttpLocalhost8080HquHqapi1.AlertdefinitionDeleteHqu adDelete = + new HttpLocalhost8080HquHqapi1.AlertdefinitionDeleteHqu(); StatusResponse response = adDelete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(response); // Won't exist. } public void testSync() throws Exception { - Endpoint.AlertdefinitionSyncHqu adSync = - new Endpoint.AlertdefinitionSyncHqu(); + HttpLocalhost8080HquHqapi1.AlertdefinitionSyncHqu adSync = + new HttpLocalhost8080HquHqapi1.AlertdefinitionSyncHqu(); AlertDefinitionsRequest request = new AlertDefinitionsRequest(); - AlertDefinitionsResponse response = adSync.postAsAlertDefinitionsResponse(request); + AlertDefinitionsResponse response = adSync.postApplicationXmlAsAlertDefinitionsResponse(request); hqAssertSuccess(response); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlert_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlert_test.java index 1f9e09c3..ff57453b 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlert_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAlert_test.java @@ -5,7 +5,7 @@ public class WADLAlert_test extends WADLTestBase { public void testFind() throws Exception { - Endpoint.AlertFindHqu find = new Endpoint.AlertFindHqu(); + HttpLocalhost8080HquHqapi1.AlertFindHqu find = new HttpLocalhost8080HquHqapi1.AlertFindHqu(); AlertsResponse response = find.getAsAlertsResponse(0l, System.currentTimeMillis(), 10, 1); @@ -13,7 +13,7 @@ public void testFind() throws Exception { } public void testFindByResource() throws Exception { - Endpoint.AlertFindByResourceHqu find = new Endpoint.AlertFindByResourceHqu(); + HttpLocalhost8080HquHqapi1.AlertFindByResourceHqu find = new HttpLocalhost8080HquHqapi1.AlertFindByResourceHqu(); AlertsResponse response = find.getAsAlertsResponse(Integer.MAX_VALUE, 0l, System.currentTimeMillis(), @@ -22,21 +22,21 @@ public void testFindByResource() throws Exception { } public void testAck() throws Exception { - Endpoint.AlertAckHqu ack = new Endpoint.AlertAckHqu(); + HttpLocalhost8080HquHqapi1.AlertAckHqu ack = new HttpLocalhost8080HquHqapi1.AlertAckHqu(); AlertsResponse response = ack.getAsAlertsResponse(Integer.MAX_VALUE, "Test ack"); hqAssertFailure(response); // Alert will not exist } public void testFix() throws Exception { - Endpoint.AlertFixHqu fix = new Endpoint.AlertFixHqu(); + HttpLocalhost8080HquHqapi1.AlertFixHqu fix = new HttpLocalhost8080HquHqapi1.AlertFixHqu(); AlertsResponse response = fix.getAsAlertsResponse(Integer.MAX_VALUE); hqAssertFailure(response); // Alert will not exist } public void testDelete() throws Exception { - Endpoint.AlertDeleteHqu delete = new Endpoint.AlertDeleteHqu(); + HttpLocalhost8080HquHqapi1.AlertDeleteHqu delete = new HttpLocalhost8080HquHqapi1.AlertDeleteHqu(); StatusResponse response = delete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(response); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLApplication_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLApplication_test.java index c577cde7..94d2ca04 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLApplication_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLApplication_test.java @@ -1,6 +1,6 @@ package org.hyperic.hq.hqapi1.test; -import org.hyperic.hq.hqapi1.wadl.Endpoint; +import org.hyperic.hq.hqapi1.wadl.HttpLocalhost8080HquHqapi1; import org.hyperic.hq.hqapi1.wadl.*; import java.util.Random; @@ -32,57 +32,57 @@ protected Application generateTestApplication() } public void testList() throws Exception { - Endpoint.ApplicationListHqu list = - new Endpoint.ApplicationListHqu(); + HttpLocalhost8080HquHqapi1.ApplicationListHqu list = + new HttpLocalhost8080HquHqapi1.ApplicationListHqu(); ApplicationsResponse response = list.getAsApplicationsResponse(); hqAssertSuccess(response); } public void testCreate() throws Exception { - Endpoint.ApplicationCreateHqu create = - new Endpoint.ApplicationCreateHqu(); + HttpLocalhost8080HquHqapi1.ApplicationCreateHqu create = + new HttpLocalhost8080HquHqapi1.ApplicationCreateHqu(); Application a = generateTestApplication(); ApplicationRequest req = new ApplicationRequest(); req.setApplication(a); ApplicationResponse response = - create.postAsApplicationResponse(req); + create.postApplicationXmlAsApplicationResponse(req); hqAssertSuccess(response); - Endpoint.ApplicationDeleteHqu delete = - new Endpoint.ApplicationDeleteHqu(); + HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu delete = + new HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu(); StatusResponse deleteResponse = delete.getAsStatusResponse(response.getApplication().getId()); hqAssertSuccess(deleteResponse); } public void testUpdate() throws Exception { - Endpoint.ApplicationUpdateHqu update = - new Endpoint.ApplicationUpdateHqu(); + HttpLocalhost8080HquHqapi1.ApplicationUpdateHqu update = + new HttpLocalhost8080HquHqapi1.ApplicationUpdateHqu(); Application a = generateTestApplication(); ApplicationRequest req = new ApplicationRequest(); req.setApplication(a); - ApplicationResponse resp = update.postAsApplicationResponse(req); + ApplicationResponse resp = update.postApplicationXmlAsApplicationResponse(req); hqAssertFailure(resp); } public void testSync() throws Exception { - Endpoint.ApplicationSyncHqu sync = - new Endpoint.ApplicationSyncHqu(); + HttpLocalhost8080HquHqapi1.ApplicationSyncHqu sync = + new HttpLocalhost8080HquHqapi1.ApplicationSyncHqu(); Application a = generateTestApplication(); ApplicationsRequest req = new ApplicationsRequest(); req.getApplication().add(a); - ApplicationsResponse response = sync.postAsApplicationsResponse(req); + ApplicationsResponse response = sync.postApplicationXmlAsApplicationsResponse(req); hqAssertSuccess(response); - Endpoint.ApplicationDeleteHqu delete = - new Endpoint.ApplicationDeleteHqu(); + HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu delete = + new HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu(); for (Application app : response.getApplication()) { StatusResponse deleteResponse = delete.getAsStatusResponse(app.getId()); hqAssertSuccess(deleteResponse); @@ -90,8 +90,8 @@ public void testSync() throws Exception { } public void testDelete() throws Exception { - Endpoint.ApplicationDeleteHqu delete = - new Endpoint.ApplicationDeleteHqu(); + HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu delete = + new HttpLocalhost8080HquHqapi1.ApplicationDeleteHqu(); StatusResponse deleteResponse = delete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(deleteResponse); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAutodiscovery_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAutodiscovery_test.java index aa2bf82e..22874535 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAutodiscovery_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLAutodiscovery_test.java @@ -6,8 +6,8 @@ public class WADLAutodiscovery_test extends WADLTestBase { public void testGetQueue() throws Exception { - Endpoint.AutodiscoveryGetQueueHqu adGetQueue = - new Endpoint.AutodiscoveryGetQueueHqu(); + HttpLocalhost8080HquHqapi1.AutodiscoveryGetQueueHqu adGetQueue = + new HttpLocalhost8080HquHqapi1.AutodiscoveryGetQueueHqu(); QueueResponse queue = adGetQueue.getAsQueueResponse(); hqAssertSuccess(queue); @@ -15,8 +15,8 @@ public void testGetQueue() throws Exception { public void testApprove() throws Exception { - Endpoint.AutodiscoveryApproveHqu adApprove = - new Endpoint.AutodiscoveryApproveHqu(); + HttpLocalhost8080HquHqapi1.AutodiscoveryApproveHqu adApprove = + new HttpLocalhost8080HquHqapi1.AutodiscoveryApproveHqu(); StatusResponse approve = adApprove.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(approve); // That id won't exist, just testing endpoints. diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLControl_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLControl_test.java index 53248865..67fcebd0 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLControl_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLControl_test.java @@ -32,8 +32,8 @@ public class WADLControl_test extends WADLTestBase { public void testActions() throws Exception { - Endpoint.ControlActionsHqu actions = - new Endpoint.ControlActionsHqu(); + HttpLocalhost8080HquHqapi1.ControlActionsHqu actions = + new HttpLocalhost8080HquHqapi1.ControlActionsHqu(); ControlActionResponse response = actions.getAsControlActionResponse(Integer.MAX_VALUE); @@ -41,8 +41,8 @@ public void testActions() throws Exception { } public void testHistory() throws Exception { - Endpoint.ControlHistoryHqu history = - new Endpoint.ControlHistoryHqu(); + HttpLocalhost8080HquHqapi1.ControlHistoryHqu history = + new HttpLocalhost8080HquHqapi1.ControlHistoryHqu(); ControlHistoryResponse response = history.getAsControlHistoryResponse(Integer.MAX_VALUE); @@ -50,8 +50,8 @@ public void testHistory() throws Exception { } public void testExecute() throws Exception { - Endpoint.ControlExecuteHqu execute = - new Endpoint.ControlExecuteHqu(); + HttpLocalhost8080HquHqapi1.ControlExecuteHqu execute = + new HttpLocalhost8080HquHqapi1.ControlExecuteHqu(); StatusResponse response = execute.getAsStatusResponse(Integer.MAX_VALUE, "none", diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEscalation_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEscalation_test.java index e6a9dbe3..524b406c 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEscalation_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEscalation_test.java @@ -5,34 +5,34 @@ public class WADLEscalation_test extends WADLTestBase { public void testEscalationGet() throws Exception { - Endpoint.EscalationGetHqu escGet = new Endpoint.EscalationGetHqu(); + HttpLocalhost8080HquHqapi1.EscalationGetHqu escGet = new HttpLocalhost8080HquHqapi1.EscalationGetHqu(); EscalationResponse response = escGet.getAsEscalationResponse("Some Esc"); hqAssertFailure(response); // Won't exist } public void testEscalationList() throws Exception { - Endpoint.EscalationListHqu escList = new Endpoint.EscalationListHqu(); + HttpLocalhost8080HquHqapi1.EscalationListHqu escList = new HttpLocalhost8080HquHqapi1.EscalationListHqu(); EscalationsResponse response = escList.getAsEscalationsResponse(); hqAssertSuccess(response); } public void testEscalationDelete() throws Exception { - Endpoint.EscalationDeleteHqu escDelete = - new Endpoint.EscalationDeleteHqu(); + HttpLocalhost8080HquHqapi1.EscalationDeleteHqu escDelete = + new HttpLocalhost8080HquHqapi1.EscalationDeleteHqu(); StatusResponse response = escDelete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(response); // Won't exist } public void testEscalationSync() throws Exception { - Endpoint.EscalationSyncHqu escSync = - new Endpoint.EscalationSyncHqu(); + HttpLocalhost8080HquHqapi1.EscalationSyncHqu escSync = + new HttpLocalhost8080HquHqapi1.EscalationSyncHqu(); EscalationsRequest request = new EscalationsRequest(); - StatusResponse response = escSync.postAsStatusResponse(request); + StatusResponse response = escSync.postApplicationXmlAsStatusResponse(request); hqAssertSuccess(response); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEvent_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEvent_test.java index d5c94a5f..708c2f55 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEvent_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLEvent_test.java @@ -5,7 +5,7 @@ public class WADLEvent_test extends WADLTestBase { public void testFind() throws Exception { - Endpoint.EventFindHqu find = new Endpoint.EventFindHqu(); + HttpLocalhost8080HquHqapi1.EventFindHqu find = new HttpLocalhost8080HquHqapi1.EventFindHqu(); EventsResponse response = find.getAsEventsResponse(0l, System.currentTimeMillis(), 100); @@ -13,7 +13,7 @@ public void testFind() throws Exception { } public void testFindByResource() throws Exception { - Endpoint.EventFindByResourceHqu find = new Endpoint.EventFindByResourceHqu(); + HttpLocalhost8080HquHqapi1.EventFindByResourceHqu find = new HttpLocalhost8080HquHqapi1.EventFindByResourceHqu(); EventsResponse response = find.getAsEventsResponse(Integer.MAX_VALUE, 0l, diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLGroup_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLGroup_test.java index a5bc9385..08bf11f3 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLGroup_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLGroup_test.java @@ -5,31 +5,31 @@ public class WADLGroup_test extends WADLTestBase { public void testGroupList() throws Exception { - Endpoint.GroupListHqu groupList = new Endpoint.GroupListHqu(); + HttpLocalhost8080HquHqapi1.GroupListHqu groupList = new HttpLocalhost8080HquHqapi1.GroupListHqu(); GroupsResponse response = groupList.getAsGroupsResponse(); hqAssertSuccess(response); } public void testGroupGet() throws Exception { - Endpoint.GroupGetHqu groupGet = new Endpoint.GroupGetHqu(); + HttpLocalhost8080HquHqapi1.GroupGetHqu groupGet = new HttpLocalhost8080HquHqapi1.GroupGetHqu(); GroupResponse response = groupGet.getAsGroupResponse("Some group"); hqAssertFailure(response); } public void testGroupDelete() throws Exception { - Endpoint.GroupDeleteHqu groupDelete = new Endpoint.GroupDeleteHqu(); + HttpLocalhost8080HquHqapi1.GroupDeleteHqu groupDelete = new HttpLocalhost8080HquHqapi1.GroupDeleteHqu(); StatusResponse response = groupDelete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(response); } public void testGroupSync() throws Exception { - Endpoint.GroupSyncHqu groupSync = new Endpoint.GroupSyncHqu(); + HttpLocalhost8080HquHqapi1.GroupSyncHqu groupSync = new HttpLocalhost8080HquHqapi1.GroupSyncHqu(); GroupsRequest request = new GroupsRequest(); - GroupsResponse response = groupSync.postAsGroupsResponse(request); + GroupsResponse response = groupSync.postApplicationXmlAsGroupsResponse(request); hqAssertSuccess(response); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMaintenance_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMaintenance_test.java index 73129705..54458bd9 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMaintenance_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMaintenance_test.java @@ -5,15 +5,15 @@ public class WADLMaintenance_test extends WADLTestBase { public void testGet() throws Exception { - Endpoint.MaintenanceGetHqu maintGet = new Endpoint.MaintenanceGetHqu(); + HttpLocalhost8080HquHqapi1.MaintenanceGetHqu maintGet = new HttpLocalhost8080HquHqapi1.MaintenanceGetHqu(); MaintenanceResponse response = maintGet.getAsMaintenanceResponse(Integer.MAX_VALUE); hqAssertFailure(response); } public void testSchedule() throws Exception { - Endpoint.MaintenanceScheduleHqu maintSchedule = - new Endpoint.MaintenanceScheduleHqu(); + HttpLocalhost8080HquHqapi1.MaintenanceScheduleHqu maintSchedule = + new HttpLocalhost8080HquHqapi1.MaintenanceScheduleHqu(); MaintenanceResponse response = maintSchedule.getAsMaintenanceResponse(Integer.MAX_VALUE, @@ -23,8 +23,8 @@ public void testSchedule() throws Exception { } public void testUnschedule() throws Exception { - Endpoint.MaintenanceUnscheduleHqu maintUnschedule = - new Endpoint.MaintenanceUnscheduleHqu(); + HttpLocalhost8080HquHqapi1.MaintenanceUnscheduleHqu maintUnschedule = + new HttpLocalhost8080HquHqapi1.MaintenanceUnscheduleHqu(); StatusResponse response = maintUnschedule.getAsStatusResponse(Integer.MAX_VALUE); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetricData_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetricData_test.java index 71767494..a6e9676c 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetricData_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetricData_test.java @@ -8,7 +8,7 @@ public class WADLMetricData_test extends WADLTestBase { public void testGet() throws Exception { - Endpoint.MetricDataGetHqu get = new Endpoint.MetricDataGetHqu(); + HttpLocalhost8080HquHqapi1.MetricDataGetHqu get = new HttpLocalhost8080HquHqapi1.MetricDataGetHqu(); MetricDataResponse response = get.getAsMetricDataResponse(Integer.MAX_VALUE, @@ -17,7 +17,7 @@ public void testGet() throws Exception { } public void testGetLast() throws Exception { - Endpoint.MetricDataGetLastHqu last = new Endpoint.MetricDataGetLastHqu(); + HttpLocalhost8080HquHqapi1.MetricDataGetLastHqu last = new HttpLocalhost8080HquHqapi1.MetricDataGetLastHqu(); LastMetricDataResponse response = last.getAsLastMetricDataResponse(Integer.MAX_VALUE); @@ -25,7 +25,7 @@ public void testGetLast() throws Exception { } public void testGetMulti() throws Exception { - Endpoint.MetricDataGetMultiHqu multi = new Endpoint.MetricDataGetMultiHqu(); + HttpLocalhost8080HquHqapi1.MetricDataGetMultiHqu multi = new HttpLocalhost8080HquHqapi1.MetricDataGetMultiHqu(); List ids = new ArrayList(); ids.add(0); @@ -38,8 +38,8 @@ public void testGetMulti() throws Exception { } public void testGetMultiLast() throws Exception { - Endpoint.MetricDataGetMultiLastHqu multiLast = - new Endpoint.MetricDataGetMultiLastHqu(); + HttpLocalhost8080HquHqapi1.MetricDataGetMultiLastHqu multiLast = + new HttpLocalhost8080HquHqapi1.MetricDataGetMultiLastHqu(); List ids = new ArrayList(); ids.add(0); @@ -51,7 +51,7 @@ public void testGetMultiLast() throws Exception { } public void testPut() throws Exception { - Endpoint.MetricDataPutHqu put = new Endpoint.MetricDataPutHqu(); + HttpLocalhost8080HquHqapi1.MetricDataPutHqu put = new HttpLocalhost8080HquHqapi1.MetricDataPutHqu(); List dps = new ArrayList(); DataPoint dp = new DataPoint(); @@ -63,7 +63,7 @@ public void testPut() throws Exception { request.setMetricId(Integer.MAX_VALUE); request.getDataPoint().addAll(dps); - StatusResponse response = put.postAsStatusResponse(request); + StatusResponse response = put.postApplicationXmlAsStatusResponse(request); hqAssertFailure(response); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetric_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetric_test.java index db6f650a..df4db971 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetric_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLMetric_test.java @@ -20,10 +20,10 @@ public class WADLMetric_test extends WADLTestBase { public void testGetMetricTemplates() throws Exception { - Endpoint.MetricGetTemplatesHqu getTemplates = - new Endpoint.MetricGetTemplatesHqu(); - Endpoint.MetricGetMetricTemplateHqu getTemplate = - new Endpoint.MetricGetMetricTemplateHqu(); + HttpLocalhost8080HquHqapi1.MetricGetTemplatesHqu getTemplates = + new HttpLocalhost8080HquHqapi1.MetricGetTemplatesHqu(); + HttpLocalhost8080HquHqapi1.MetricGetMetricTemplateHqu getTemplate = + new HttpLocalhost8080HquHqapi1.MetricGetMetricTemplateHqu(); MetricTemplatesResponse response = getTemplates.getAsMetricTemplatesResponse("CPU"); hqAssertSuccess(response); @@ -37,16 +37,16 @@ public void testGetMetricTemplates() throws Exception { public void testGetMetrics() throws Exception { - Endpoint.MetricGetMetricHqu getMetric = - new Endpoint.MetricGetMetricHqu(); - Endpoint.MetricGetMetricsHqu getMetrics = - new Endpoint.MetricGetMetricsHqu(); - Endpoint.ResourceFindHqu resourceFind = - new Endpoint.ResourceFindHqu(); - Endpoint.MetricGetResourceDataHqu getResourceData = - new Endpoint.MetricGetResourceDataHqu(); - Endpoint.MetricGetDataHqu getMetricData = - new Endpoint.MetricGetDataHqu(); + HttpLocalhost8080HquHqapi1.MetricGetMetricHqu getMetric = + new HttpLocalhost8080HquHqapi1.MetricGetMetricHqu(); + HttpLocalhost8080HquHqapi1.MetricGetMetricsHqu getMetrics = + new HttpLocalhost8080HquHqapi1.MetricGetMetricsHqu(); + HttpLocalhost8080HquHqapi1.ResourceFindHqu resourceFind = + new HttpLocalhost8080HquHqapi1.ResourceFindHqu(); + HttpLocalhost8080HquHqapi1.MetricGetResourceDataHqu getResourceData = + new HttpLocalhost8080HquHqapi1.MetricGetResourceDataHqu(); + HttpLocalhost8080HquHqapi1.MetricGetDataHqu getMetricData = + new HttpLocalhost8080HquHqapi1.MetricGetDataHqu(); ResourcesResponse resources = resourceFind.getAsResourcesResponse(null, "CPU", null, false, false); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLResource_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLResource_test.java index 9e76c8c9..5b289c21 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLResource_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLResource_test.java @@ -5,8 +5,8 @@ public class WADLResource_test extends WADLTestBase { public void testResourceFindGet() throws Exception { - Endpoint.ResourceFindHqu resourceFind = new Endpoint.ResourceFindHqu(); - Endpoint.ResourceGetHqu resourceGet = new Endpoint.ResourceGetHqu(); + HttpLocalhost8080HquHqapi1.ResourceFindHqu resourceFind = new HttpLocalhost8080HquHqapi1.ResourceFindHqu(); + HttpLocalhost8080HquHqapi1.ResourceGetHqu resourceGet = new HttpLocalhost8080HquHqapi1.ResourceGetHqu(); ResourcesResponse response = resourceFind.getAsResourcesResponse(null, "CPU", null, false, false); @@ -24,23 +24,23 @@ public void testResourceFindGet() throws Exception { } public void testCreatePlatform() throws Exception { - Endpoint.ResourceCreatePlatformHqu createPlatform = - new Endpoint.ResourceCreatePlatformHqu(); - Endpoint.ResourceDeleteHqu deleteResource = - new Endpoint.ResourceDeleteHqu(); + HttpLocalhost8080HquHqapi1.ResourceCreatePlatformHqu createPlatform = + new HttpLocalhost8080HquHqapi1.ResourceCreatePlatformHqu(); + HttpLocalhost8080HquHqapi1.ResourceDeleteHqu deleteResource = + new HttpLocalhost8080HquHqapi1.ResourceDeleteHqu(); } public void testCreateResource() throws Exception { - Endpoint.ResourceCreateResourceHqu createResource = - new Endpoint.ResourceCreateResourceHqu(); - Endpoint.ResourceDeleteHqu deleteResource = - new Endpoint.ResourceDeleteHqu(); - Endpoint.ResourceSyncHqu syncResource = new Endpoint.ResourceSyncHqu(); + HttpLocalhost8080HquHqapi1.ResourceCreateResourceHqu createResource = + new HttpLocalhost8080HquHqapi1.ResourceCreateResourceHqu(); + HttpLocalhost8080HquHqapi1.ResourceDeleteHqu deleteResource = + new HttpLocalhost8080HquHqapi1.ResourceDeleteHqu(); + HttpLocalhost8080HquHqapi1.ResourceSyncHqu syncResource = new HttpLocalhost8080HquHqapi1.ResourceSyncHqu(); } public void testGetResourcePrototypes() throws Exception { - Endpoint.ResourceGetResourcePrototypesHqu resourceGetPrototypes = - new Endpoint.ResourceGetResourcePrototypesHqu(); + HttpLocalhost8080HquHqapi1.ResourceGetResourcePrototypesHqu resourceGetPrototypes = + new HttpLocalhost8080HquHqapi1.ResourceGetResourcePrototypesHqu(); ResourcePrototypesResponse response = resourceGetPrototypes.getAsResourcePrototypesResponse(); @@ -55,8 +55,8 @@ public void testGetResourcePrototypes() throws Exception { } public void testGetResourcePrototype() throws Exception { - Endpoint.ResourceGetResourcePrototypeHqu resourceGetPrototype = - new Endpoint.ResourceGetResourcePrototypeHqu(); + HttpLocalhost8080HquHqapi1.ResourceGetResourcePrototypeHqu resourceGetPrototype = + new HttpLocalhost8080HquHqapi1.ResourceGetResourcePrototypeHqu(); ResourcePrototypeResponse response = resourceGetPrototype.getAsResourcePrototypeResponse("CPU"); diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLRole_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLRole_test.java index d7cb9437..adb696e1 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLRole_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLRole_test.java @@ -5,31 +5,31 @@ public class WADLRole_test extends WADLTestBase { public void testRoleList() throws Exception { - Endpoint.RoleListHqu roleList = new Endpoint.RoleListHqu(); + HttpLocalhost8080HquHqapi1.RoleListHqu roleList = new HttpLocalhost8080HquHqapi1.RoleListHqu(); RolesResponse response = roleList.getAsRolesResponse(); hqAssertSuccess(response); } public void testRoleGet() throws Exception { - Endpoint.RoleGetHqu roleGet = new Endpoint.RoleGetHqu(); + HttpLocalhost8080HquHqapi1.RoleGetHqu roleGet = new HttpLocalhost8080HquHqapi1.RoleGetHqu(); RoleResponse response = roleGet.getAsRoleResponse("Some role"); hqAssertFailure(response); } public void testRoleDelete() throws Exception { - Endpoint.RoleDeleteHqu roleDelete = new Endpoint.RoleDeleteHqu(); + HttpLocalhost8080HquHqapi1.RoleDeleteHqu roleDelete = new HttpLocalhost8080HquHqapi1.RoleDeleteHqu(); StatusResponse response = roleDelete.getAsStatusResponse(Integer.MAX_VALUE); hqAssertFailure(response); } public void testRoleSync() throws Exception { - Endpoint.RoleSyncHqu roleSync = new Endpoint.RoleSyncHqu(); + HttpLocalhost8080HquHqapi1.RoleSyncHqu roleSync = new HttpLocalhost8080HquHqapi1.RoleSyncHqu(); RolesRequest request = new RolesRequest(); - StatusResponse response = roleSync.postAsStatusResponse(request); + StatusResponse response = roleSync.postApplicationXmlAsStatusResponse(request); hqAssertSuccess(response); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java index 841b920c..719a1f9f 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLServerConfig_test.java @@ -5,18 +5,18 @@ public class WADLServerConfig_test extends WADLTestBase { public void testGet() throws Exception { - Endpoint.ServerConfigGetConfigHqu get = - new Endpoint.ServerConfigGetConfigHqu(); + HttpLocalhost8080HquHqapi1.ServerConfigGetConfigHqu get = + new HttpLocalhost8080HquHqapi1.ServerConfigGetConfigHqu(); ServerConfigResponse response = get.getAsServerConfigResponse(); hqAssertSuccess(response); } public void testSet() throws Exception { - Endpoint.ServerConfigGetConfigHqu get = - new Endpoint.ServerConfigGetConfigHqu(); - Endpoint.ServerConfigSetConfigHqu set = - new Endpoint.ServerConfigSetConfigHqu(); + HttpLocalhost8080HquHqapi1.ServerConfigGetConfigHqu get = + new HttpLocalhost8080HquHqapi1.ServerConfigGetConfigHqu(); + HttpLocalhost8080HquHqapi1.ServerConfigSetConfigHqu set = + new HttpLocalhost8080HquHqapi1.ServerConfigSetConfigHqu(); ServerConfigResponse response = get.getAsServerConfigResponse(); hqAssertSuccess(response); @@ -24,7 +24,7 @@ public void testSet() throws Exception { ServerConfigRequest request = new ServerConfigRequest(); request.getServerConfig().addAll(response.getServerConfig()); - StatusResponse setResponse = set.postAsStatusResponse(request); + StatusResponse setResponse = set.postApplicationXmlAsStatusResponse(request); hqAssertSuccess(setResponse); } } diff --git a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLUser_test.java b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLUser_test.java index 2878d377..955662b7 100644 --- a/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLUser_test.java +++ b/hqapi1-integration-tests/src/test/java/org/hyperic/hq/hqapi1/test/WADLUser_test.java @@ -6,7 +6,7 @@ public class WADLUser_test extends WADLTestBase { public void testUserList() throws Exception { - Endpoint.UserListHqu userList = new Endpoint.UserListHqu(); + HttpLocalhost8080HquHqapi1.UserListHqu userList = new HttpLocalhost8080HquHqapi1.UserListHqu(); UsersResponse users = userList.getAsUsersResponse(); hqAssertSuccess(users); @@ -14,7 +14,7 @@ public void testUserList() throws Exception { public void testUserGet() throws Exception { - Endpoint.UserGetHqu userGet = new Endpoint.UserGetHqu(); + HttpLocalhost8080HquHqapi1.UserGetHqu userGet = new HttpLocalhost8080HquHqapi1.UserGetHqu(); UserResponse user = userGet.getAsUserResponse("guest"); hqAssertSuccess(user); @@ -22,11 +22,11 @@ public void testUserGet() throws Exception { public void testUserCreateDeleteSyncChangePassword() throws Exception { - Endpoint.UserCreateHqu userCreate = new Endpoint.UserCreateHqu(); - Endpoint.UserDeleteHqu userDelete = new Endpoint.UserDeleteHqu(); - Endpoint.UserChangePasswordHqu userChangePassword = - new Endpoint.UserChangePasswordHqu(); - Endpoint.UserSyncHqu userSync = new Endpoint.UserSyncHqu(); + HttpLocalhost8080HquHqapi1.UserCreateHqu userCreate = new HttpLocalhost8080HquHqapi1.UserCreateHqu(); + HttpLocalhost8080HquHqapi1.UserDeleteHqu userDelete = new HttpLocalhost8080HquHqapi1.UserDeleteHqu(); + HttpLocalhost8080HquHqapi1.UserChangePasswordHqu userChangePassword = + new HttpLocalhost8080HquHqapi1.UserChangePasswordHqu(); + HttpLocalhost8080HquHqapi1.UserSyncHqu userSync = new HttpLocalhost8080HquHqapi1.UserSyncHqu(); // Test User Sync - Required Atts UserResponse responseReq = userCreate.getAsUserResponse("testWadl", @@ -64,7 +64,7 @@ public void testUserCreateDeleteSyncChangePassword() throws Exception { u.setFirstName("New First Name"); UsersRequest r = new UsersRequest(); r.getUser().add(u); - StatusResponse syncResponse = userSync.postAsStatusResponse(r); + StatusResponse syncResponse = userSync.postApplicationXmlAsStatusResponse(r); hqAssertSuccess(syncResponse); StatusResponse deleteOpt = userDelete.getAsStatusResponse(responseOpt.getUser().getName()); diff --git a/hqapi1/pom.xml b/hqapi1/pom.xml index d5c0dfe8..b9499b3f 100644 --- a/hqapi1/pom.xml +++ b/hqapi1/pom.xml @@ -29,14 +29,37 @@ - + + + + com.sun.localizer + localizer + ${localizer.version} + + @@ -44,7 +67,7 @@ - --> + org.apache.maven.plugins maven-javadoc-plugin diff --git a/hqapi1/src/main/wadl/HQApi1.wadl b/hqapi1/src/main/wadl/HQApi1.wadl index d80c3e13..c47275e8 100644 --- a/hqapi1/src/main/wadl/HQApi1.wadl +++ b/hqapi1/src/main/wadl/HQApi1.wadl @@ -1,7 +1,7 @@ + xmlns:wadl="http://wadl.dev.java.net/2009/02"> This document describes the methods available through Hyperic's web