public class FakeServerInventory extends Object
The methods are not exhaustive and were added on as-needed basis. If this class doesn't cover what you need, either add the functionality directly to it, subclass or roll your own. It is only meant as a helper.
This impl uses mockito for defining the answers to various calls.
| Modifier and Type | Class and Description |
|---|---|
static class |
FakeServerInventory.CompleteDiscoveryChecker
You can
FakeServerInventory.CompleteDiscoveryChecker.waitForDiscoveryComplete() on an instance of this class
for the complete discovery to finish in case your
fake server commits some resources (which starts off
asynchronous discovery of children). |
| Constructor and Description |
|---|
FakeServerInventory() |
FakeServerInventory(boolean failing) |
| Modifier and Type | Method and Description |
|---|---|
org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.MergeResourceResponse> |
addResource() |
org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.ResourceSyncInfo> |
clearPlatform() |
FakeServerInventory.CompleteDiscoveryChecker |
createAsyncDiscoveryCompletionChecker(int expectedResourceTreeDepth) |
Set<org.rhq.core.domain.resource.Resource> |
findResourcesByType(org.rhq.core.domain.resource.ResourceType type) |
org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> |
getLatestSchedulesForResourceIds() |
org.mockito.stubbing.Answer<Set<org.rhq.core.domain.resource.Resource>> |
getResources() |
Map<String,org.rhq.core.domain.resource.Resource> |
getResourceStore() |
int |
getResourceTreeDepth() |
boolean |
isFailing() |
boolean |
isFailUpgrade() |
org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.MergeInventoryReportResults> |
mergeInventoryReport(org.rhq.core.domain.resource.InventoryStatus requiredInventoryStatus) |
org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> |
postProcessNewlyCommittedResources() |
void |
prepopulateInventory(org.rhq.core.domain.resource.Resource platform,
Collection<org.rhq.core.domain.resource.Resource> topLevelServers) |
void |
removeResource(org.rhq.core.domain.resource.Resource r) |
void |
setFailing(boolean failing) |
void |
setFailUpgrade(boolean failUpgrade) |
org.mockito.stubbing.Answer<Void> |
setResourceError() |
org.mockito.stubbing.Answer<Set<org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeResponse>> |
upgradeResources() |
public FakeServerInventory()
public FakeServerInventory(boolean failing)
public void prepopulateInventory(org.rhq.core.domain.resource.Resource platform,
Collection<org.rhq.core.domain.resource.Resource> topLevelServers)
public FakeServerInventory.CompleteDiscoveryChecker createAsyncDiscoveryCompletionChecker(int expectedResourceTreeDepth)
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.MergeResourceResponse> addResource()
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.MergeInventoryReportResults> mergeInventoryReport(org.rhq.core.domain.resource.InventoryStatus requiredInventoryStatus)
public int getResourceTreeDepth()
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.ResourceSyncInfo> clearPlatform()
public org.mockito.stubbing.Answer<Void> setResourceError()
public org.mockito.stubbing.Answer<Set<org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeResponse>> upgradeResources()
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.resource.Resource>> getResources()
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> getLatestSchedulesForResourceIds()
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> postProcessNewlyCommittedResources()
public boolean isFailing()
public void setFailing(boolean failing)
public boolean isFailUpgrade()
public void setFailUpgrade(boolean failUpgrade)
public Set<org.rhq.core.domain.resource.Resource> findResourcesByType(org.rhq.core.domain.resource.ResourceType type)
public void removeResource(org.rhq.core.domain.resource.Resource r)
Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.