Skip to content

Commit

Permalink
Merge branch 'wadl'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Morgan committed Jun 29, 2009
2 parents 4bf6600 + 7242076 commit b807fe6
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/org/hyperic/hq/hqapi1/test/WADLGroup_test.java
@@ -0,0 +1,35 @@
package org.hyperic.hq.hqapi1.test;

import org.hyperic.hq.hqapi1.wadl.*;

public class WADLGroup_test extends WADLTestBase {

public void testGroupList() throws Exception {
Endpoint.GroupListHqu groupList = new Endpoint.GroupListHqu();

GroupsResponse response = groupList.getAsGroupsResponse();
hqAssertSuccess(response);
}

public void testGroupGet() throws Exception {
Endpoint.GroupGetHqu groupGet = new Endpoint.GroupGetHqu();

GroupResponse response = groupGet.getAsGroupResponse("Some group");
hqAssertFailure(response);
}

public void testGroupDelete() throws Exception {
Endpoint.GroupDeleteHqu groupDelete = new Endpoint.GroupDeleteHqu();

StatusResponse response = groupDelete.getAsStatusResponse(Integer.MAX_VALUE);
hqAssertFailure(response);
}

public void testGroupSync() throws Exception {
Endpoint.GroupSyncHqu groupSync = new Endpoint.GroupSyncHqu();
GroupsRequest request = new GroupsRequest();

GroupsResponse response = groupSync.postAsGroupsResponse(request);
hqAssertSuccess(response);
}
}
35 changes: 35 additions & 0 deletions src/org/hyperic/hq/hqapi1/test/WADLRole_test.java
@@ -0,0 +1,35 @@
package org.hyperic.hq.hqapi1.test;

import org.hyperic.hq.hqapi1.wadl.*;

public class WADLRole_test extends WADLTestBase {

public void testRoleList() throws Exception {
Endpoint.RoleListHqu roleList = new Endpoint.RoleListHqu();

RolesResponse response = roleList.getAsRolesResponse();
hqAssertSuccess(response);
}

public void testRoleGet() throws Exception {
Endpoint.RoleGetHqu roleGet = new Endpoint.RoleGetHqu();

RoleResponse response = roleGet.getAsRoleResponse("Some role");
hqAssertFailure(response);
}

public void testRoleDelete() throws Exception {
Endpoint.RoleDeleteHqu roleDelete = new Endpoint.RoleDeleteHqu();

StatusResponse response = roleDelete.getAsStatusResponse(Integer.MAX_VALUE);
hqAssertFailure(response);
}

public void testRoleSync() throws Exception {
Endpoint.RoleSyncHqu roleSync = new Endpoint.RoleSyncHqu();
RolesRequest request = new RolesRequest();

StatusResponse response = roleSync.postAsStatusResponse(request);
hqAssertSuccess(response);
}
}
146 changes: 146 additions & 0 deletions xsd/HQApi1.wadl
Expand Up @@ -970,6 +970,152 @@
</wadl:method>
</wadl:resource>

<wadl:resource path="group/get.hqu">
<wadl:doc title="HQApi Group get command">
Get a Group
</wadl:doc>
<wadl:method name="GET" id="GroupGet">
<wadl:request>
<wadl:param name="name" style="query" required="true"
type="xs:string">
<wadl:doc>
The name of the Group to return.
</wadl:doc>
</wadl:param>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="GroupResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="group/list.hqu">
<wadl:doc title="HQApi Group list command">
List Groups
</wadl:doc>
<wadl:method name="GET" id="GroupList">
<wadl:request>
<wadl:param name="compatible" style="query" required="false"
type="xs:boolean">
<wadl:doc>
If specified only return compatible Groups when set
to true, or mixed Groups when set to false.
</wadl:doc>
</wadl:param>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="GroupsResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="group/delete.hqu">
<wadl:doc title="HQApi Group delete command">
Delete a Group
</wadl:doc>
<wadl:method name="GET" id="GroupDelete">
<wadl:request>
<wadl:param name="id" style="query" required="true"
type="xs:int">
<wadl:doc>
The id of the Group to delete.
</wadl:doc>
</wadl:param>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="StatusResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="group/sync.hqu">
<wadl:doc title="HQApi Group sync command">
Sync Groups
</wadl:doc>
<wadl:method name="POST" id="GroupSync">
<wadl:request>
<wadl:representation mediaType="application/xml"
element="GroupsRequest"/>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="GroupsResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="role/get.hqu">
<wadl:doc title="HQApi Role get command">
Get a Role
</wadl:doc>
<wadl:method name="GET" id="RoleGet">
<wadl:request>
<wadl:param name="name" style="query" required="true"
type="xs:string">
<wadl:doc>
The name of the Role to return.
</wadl:doc>
</wadl:param>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="RoleResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="role/list.hqu">
<wadl:doc title="HQApi Role list command">
List Roles
</wadl:doc>
<wadl:method name="GET" id="RoleList">
<wadl:request/>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="RolesResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="role/delete.hqu">
<wadl:doc title="HQApi Role delete command">
Delete a Role
</wadl:doc>
<wadl:method name="GET" id="RoleDelete">
<wadl:request>
<wadl:param name="id" style="query" required="true"
type="xs:int">
<wadl:doc>
The id of the Role to delete.
</wadl:doc>
</wadl:param>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="StatusResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

<wadl:resource path="role/sync.hqu">
<wadl:doc title="HQApi Role sync command">
Sync Roles
</wadl:doc>
<wadl:method name="POST" id="RoleSync">
<wadl:request>
<wadl:representation mediaType="application/xml"
element="RolesRequest"/>
</wadl:request>
<wadl:response>
<wadl:representation mediaType="application/xml"
element="StatusResponse"/>
</wadl:response>
</wadl:method>
</wadl:resource>

</wadl:resources>

</wadl:application>

0 comments on commit b807fe6

Please sign in to comment.