Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HHQ-3658] Add MetricApi.reschedule() API.
- Loading branch information
Ryan Morgan
committed
Jan 9, 2010
1 parent
525c0dc
commit a008896
Showing
6 changed files
with
197 additions
and
1 deletion.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.hyperic.hq.hqapi1.test; | ||
|
||
import org.hyperic.hq.hqapi1.MetricApi; | ||
import org.hyperic.hq.hqapi1.types.StatusResponse; | ||
import org.hyperic.hq.hqapi1.types.Resource; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
public class MetricReschedule_test extends MetricTestBase { | ||
|
||
public MetricReschedule_test(String name) { | ||
super(name); | ||
} | ||
|
||
public void testRescheduleSingle() throws Exception { | ||
MetricApi api = getApi().getMetricApi(); | ||
|
||
Resource platform = getLocalPlatformResource(false, false); | ||
List<Resource> resources = new ArrayList<Resource>(); | ||
resources.add(platform); | ||
|
||
StatusResponse response = api.reschedule(resources); | ||
hqAssertSuccess(response); | ||
} | ||
|
||
public void testRescheduleMulti() throws Exception { | ||
MetricApi api = getApi().getMetricApi(); | ||
|
||
// Recurse flag will cause all resources on this platform to be | ||
// rescheduled. | ||
Resource platform = getLocalPlatformResource(false, true); | ||
List<Resource> resources = new ArrayList<Resource>(); | ||
resources.add(platform); | ||
|
||
StatusResponse response = api.reschedule(resources); | ||
hqAssertSuccess(response); | ||
} | ||
|
||
public void testRescheduleInvalidResource() throws Exception { | ||
MetricApi api = getApi().getMetricApi(); | ||
|
||
List<Resource> resources = new ArrayList<Resource>(); | ||
|
||
Resource r = new Resource(); | ||
r.setId(Integer.MAX_VALUE); | ||
resources.add(r); | ||
|
||
StatusResponse response = api.reschedule(resources); | ||
hqAssertFailureObjectNotFound(response); | ||
} | ||
|
||
public void testRescheduleNoResources() throws Exception { | ||
|
||
MetricApi api = getApi().getMetricApi(); | ||
|
||
List<Resource> resources = new ArrayList<Resource>(); | ||
|
||
StatusResponse response = api.reschedule(resources); | ||
hqAssertFailureInvalidParameters(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
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