Search in sources :

Example 1 with RemoteHostEndPoint

use of org.apache.cloudstack.storage.RemoteHostEndPoint in project cloudstack by apache.

the class VolumeTest method injectMockito.

@Override
protected void injectMockito() {
    List<HostVO> hosts = new ArrayList<HostVO>();
    hosts.add(this.host);
    Mockito.when(resourceMgr.listAllUpAndEnabledHosts((Type) Matchers.any(), Matchers.anyLong(), Matchers.anyLong(), Matchers.anyLong())).thenReturn(hosts);
    RemoteHostEndPoint ep = RemoteHostEndPoint.getHypervisorHostEndPoint(this.host);
    Mockito.when(epSelector.select(Matchers.any(DataObject.class), Matchers.any(DataObject.class))).thenReturn(ep);
    Mockito.when(epSelector.select(Matchers.any(DataObject.class))).thenReturn(ep);
    Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(ep);
    Mockito.when(hyGuruMgr.getGuruProcessedCommandTargetHost(Matchers.anyLong(), Matchers.any(Command.class))).thenReturn(this.host.getId());
}
Also used : DataObject(org.apache.cloudstack.engine.subsystem.api.storage.DataObject) Command(com.cloud.agent.api.Command) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) ArrayList(java.util.ArrayList) HostVO(com.cloud.host.HostVO) RemoteHostEndPoint(org.apache.cloudstack.storage.RemoteHostEndPoint)

Example 2 with RemoteHostEndPoint

use of org.apache.cloudstack.storage.RemoteHostEndPoint in project cloudstack by apache.

the class VolumeTestVmware method injectMockito.

@Override
protected void injectMockito() {
    List<HostVO> hosts = new ArrayList<HostVO>();
    hosts.add(this.host);
    Mockito.when(resourceMgr.listAllUpAndEnabledHosts((Type) Matchers.any(), Matchers.anyLong(), Matchers.anyLong(), Matchers.anyLong())).thenReturn(hosts);
    RemoteHostEndPoint ep = RemoteHostEndPoint.getHypervisorHostEndPoint(this.host);
    Mockito.when(epSelector.select(Matchers.any(DataObject.class), Matchers.any(DataObject.class))).thenReturn(ep);
    Mockito.when(epSelector.select(Matchers.any(DataObject.class))).thenReturn(ep);
    Mockito.when(epSelector.select(Matchers.any(DataStore.class))).thenReturn(ep);
}
Also used : DataObject(org.apache.cloudstack.engine.subsystem.api.storage.DataObject) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) ArrayList(java.util.ArrayList) HostVO(com.cloud.host.HostVO) RemoteHostEndPoint(org.apache.cloudstack.storage.RemoteHostEndPoint)

Aggregations

HostVO (com.cloud.host.HostVO)2 ArrayList (java.util.ArrayList)2 DataObject (org.apache.cloudstack.engine.subsystem.api.storage.DataObject)2 DataStore (org.apache.cloudstack.engine.subsystem.api.storage.DataStore)2 RemoteHostEndPoint (org.apache.cloudstack.storage.RemoteHostEndPoint)2 Command (com.cloud.agent.api.Command)1