org.rhq.test.arquillian
Class FakeServerInventory
java.lang.Object
org.rhq.test.arquillian.FakeServerInventory
public class FakeServerInventory
- extends Object
This class represents a server side database store of the inventory for the purposes
of the unit tests that need to mock out the server functionality.
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.
- Author:
- Lukas Krejci
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FakeServerInventory
public FakeServerInventory()
FakeServerInventory
public FakeServerInventory(boolean failing)
prepopulateInventory
public void prepopulateInventory(org.rhq.core.domain.resource.Resource platform,
Collection<org.rhq.core.domain.resource.Resource> topLevelServers)
createAsyncDiscoveryCompletionChecker
public FakeServerInventory.CompleteDiscoveryChecker createAsyncDiscoveryCompletionChecker(int expectedResourceTreeDepth)
addResource
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.MergeResourceResponse> addResource()
mergeInventoryReport
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.ResourceSyncInfo> mergeInventoryReport(org.rhq.core.domain.resource.InventoryStatus requiredInventoryStatus)
getResourceTreeDepth
public int getResourceTreeDepth()
clearPlatform
public org.mockito.stubbing.Answer<org.rhq.core.domain.discovery.ResourceSyncInfo> clearPlatform()
setResourceError
public org.mockito.stubbing.Answer<Void> setResourceError()
upgradeResources
public org.mockito.stubbing.Answer<Set<org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeResponse>> upgradeResources()
getResources
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.resource.Resource>> getResources()
getLatestSchedulesForResourceIds
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> getLatestSchedulesForResourceIds()
postProcessNewlyCommittedResources
public org.mockito.stubbing.Answer<Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest>> postProcessNewlyCommittedResources()
isFailing
public boolean isFailing()
setFailing
public void setFailing(boolean failing)
isFailUpgrade
public boolean isFailUpgrade()
setFailUpgrade
public void setFailUpgrade(boolean failUpgrade)
findResourcesByType
public Set<org.rhq.core.domain.resource.Resource> findResourcesByType(org.rhq.core.domain.resource.ResourceType type)
removeResource
public void removeResource(org.rhq.core.domain.resource.Resource r)
getResourceStore
public Map<String,org.rhq.core.domain.resource.Resource> getResourceStore()
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.