Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WADL resource definitions for ResourceApi.
- Loading branch information
Ryan Morgan
committed
Jun 24, 2009
1 parent
c1697f4
commit 2c78084
Showing
2 changed files
with
278 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,65 @@ | ||
package org.hyperic.hq.hqapi1.test; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* User: rmorgan | ||
* Date: Jun 24, 2009 | ||
* Time: 1:39:51 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class WADLResource_test { | ||
import org.hyperic.hq.hqapi1.wadl.*; | ||
|
||
public class WADLResource_test extends WADLTestBase { | ||
|
||
public void testResourceFindGet() throws Exception { | ||
Endpoint.ResourceFindHqu resourceFind = new Endpoint.ResourceFindHqu(); | ||
Endpoint.ResourceGetHqu resourceGet = new Endpoint.ResourceGetHqu(); | ||
|
||
ResourcesResponse response = | ||
resourceFind.getAsResourcesResponse(null, "CPU", false, false); | ||
hqAssertSuccess(response); | ||
assertTrue("No resources found", response.getResource().size() > 0); | ||
|
||
Resource r = response.getResource().get(0); | ||
ResourceResponse getResponse = resourceGet.getAsResourceResponse(r.getId(), | ||
null, | ||
false, | ||
false); | ||
hqAssertSuccess(getResponse); | ||
assertTrue("Resource names do not match", | ||
r.getName().equals(getResponse.getResource().getName())); | ||
} | ||
|
||
public void testCreatePlatform() throws Exception { | ||
Endpoint.ResourceCreatePlatformHqu createPlatform = | ||
new Endpoint.ResourceCreatePlatformHqu(); | ||
Endpoint.ResourceDeleteHqu deleteResource = | ||
new Endpoint.ResourceDeleteHqu(); | ||
} | ||
|
||
public void testCreateResource() throws Exception { | ||
Endpoint.ResourceCreateResourceHqu createResource = | ||
new Endpoint.ResourceCreateResourceHqu(); | ||
Endpoint.ResourceDeleteHqu deleteResource = | ||
new Endpoint.ResourceDeleteHqu(); | ||
Endpoint.ResourceSyncHqu syncResource = new Endpoint.ResourceSyncHqu(); | ||
} | ||
|
||
public void testGetResourcePrototypes() throws Exception { | ||
Endpoint.ResourceGetResourcePrototypesHqu resourceGetPrototypes = | ||
new Endpoint.ResourceGetResourcePrototypesHqu(); | ||
|
||
ResourcePrototypesResponse response = | ||
resourceGetPrototypes.getAsResourcePrototypesResponse(); | ||
hqAssertSuccess(response); | ||
assertTrue("No ResourcePrototypes found", | ||
response.getResourcePrototype().size() > 0); | ||
|
||
response = resourceGetPrototypes.getAsResourcePrototypesResponse(true); | ||
hqAssertSuccess(response); | ||
assertTrue("No ResourcePrototypes found", | ||
response.getResourcePrototype().size() > 0); | ||
} | ||
|
||
public void testGetResourcePrototype() throws Exception { | ||
Endpoint.ResourceGetResourcePrototypeHqu resourceGetPrototype = | ||
new Endpoint.ResourceGetResourcePrototypeHqu(); | ||
|
||
ResourcePrototypeResponse response = | ||
resourceGetPrototype.getAsResourcePrototypeResponse("CPU"); | ||
hqAssertSuccess(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters