File tree Expand file tree Collapse file tree 3 files changed +66
-1
lines changed
src/org/hyperic/hq/hqapi1/test Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Original file line number Diff line number Diff line change
1
+ package org .hyperic .hq .hqapi1 .test ;
2
+
3
+ import org .hyperic .hq .hqapi1 .wadl .*;
4
+
5
+ public class WADLAutodiscovery_test extends WADLTestBase {
6
+
7
+ public void testGetQueue () throws Exception {
8
+
9
+ Endpoint .AutodiscoveryGetQueueHqu adGetQueue =
10
+ new Endpoint .AutodiscoveryGetQueueHqu ();
11
+
12
+ QueueResponse queue = adGetQueue .getAsQueueResponse ();
13
+ hqAssertSuccess (queue );
14
+ }
15
+
16
+ public void testApprove () throws Exception {
17
+
18
+ Endpoint .AutodiscoveryApproveHqu adApprove =
19
+ new Endpoint .AutodiscoveryApproveHqu ();
20
+
21
+ StatusResponse approve = adApprove .getAsStatusResponse (Integer .MAX_VALUE );
22
+ hqAssertFailure (approve ); // That id won't exist, just testing endpoints.
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -27,4 +27,11 @@ void hqAssertSuccess(Response response) {
27
27
response .getError ().getReasonText () : "" ;
28
28
assertEquals (error , ResponseStatus .SUCCESS , response .getStatus ());
29
29
}
30
+
31
+ // Assert FAILURE
32
+ void hqAssertFailure (Response response ) {
33
+ String error = (response .getError () != null ) ?
34
+ response .getError ().getReasonText () : "" ;
35
+ assertEquals (error , ResponseStatus .FAILURE , response .getStatus ());
36
+ }
30
37
}
Original file line number Diff line number Diff line change 681
681
</wadl : response >
682
682
</wadl : method >
683
683
</wadl : resource >
684
-
684
+
685
+ <wadl : resource path =" autodiscovery/getQueue.hqu" >
686
+ <wadl : doc title =" HQApi Agent list command" >
687
+ List the Autodiscovery queue
688
+ </wadl : doc >
689
+ <wadl : method name =" GET" id =" AutodiscoveryGetQueue" >
690
+ <wadl : request />
691
+ <wadl : response >
692
+ <wadl : representation mediaType =" application/xml"
693
+ element =" QueueResponse" />
694
+ </wadl : response >
695
+ </wadl : method >
696
+ </wadl : resource >
697
+
698
+ <wadl : resource path =" autodiscovery/approve.hqu" >
699
+ <wadl : doc title =" HQApi Autodiscovery approve command" >
700
+ Approve a platform Resource into the inventory
701
+ </wadl : doc >
702
+ <wadl : method name =" GET" id =" AutodiscoveryApprove" >
703
+ <wadl : request >
704
+ <wadl : param name =" id" style =" query" required =" true"
705
+ type =" xs:int" >
706
+ <wadl : doc >
707
+ The id of the platform Resource to approve.
708
+ </wadl : doc >
709
+ </wadl : param >
710
+ </wadl : request >
711
+ <wadl : response >
712
+ <wadl : representation mediaType =" application/xml"
713
+ element =" StatusResponse" />
714
+ </wadl : response >
715
+ </wadl : method >
716
+ </wadl : resource >
717
+
718
+
685
719
</wadl : resources >
686
720
687
721
</wadl : application >
You can’t perform that action at this time.
0 commit comments