use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class GetDeviceListQueryTest method internalExecuteQuery.
/**
* Test query execution
*/
private void internalExecuteQuery() {
// Run 'GetDeviceList' command
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
returnValue.setReturnValue(lunsInput);
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.GetDeviceList), any())).thenReturn(returnValue);
// Return 'lunsFromDb'
when(lunDaoMock.getAll()).thenReturn(lunsFromDb);
// Execute command
getQuery().executeQueryCommand();
// Assert the query's results
List<LUNs> lunsActual = getQuery().getQueryReturnValue().getReturnValue();
assertEquals(lunsExpected, lunsActual);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class GetLunsByVgIdQueryTest method expectGetDeviceList.
private void expectGetDeviceList() {
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
returnValue.setReturnValue(setUpLunsFromDeviceList());
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.GetDeviceList), any())).thenReturn(returnValue);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class AbstractGetStorageDomainsWithAttachedStoragePoolGuidQueryTestCase method testEmptyStorageDomainListQuery.
@Test
public void testEmptyStorageDomainListQuery() {
StoragePool storagePool = new StoragePool();
storagePool.setStatus(StoragePoolStatus.Up);
mockStoragePoolDao(storagePool);
// Create parameters
List<StorageDomain> storageDomainList = new ArrayList<>();
StorageDomainsAndStoragePoolIdQueryParameters paramsMock = getQueryParameters();
when(paramsMock.getStorageDomainList()).thenReturn(storageDomainList);
// Run 'HSMGetStorageDomainInfo' command
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
Pair<StorageDomainStatic, Guid> storageDomainToPoolId = new Pair<>(storageDomain.getStorageStaticData(), Guid.newGuid());
returnValue.setReturnValue(storageDomainToPoolId);
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.HSMGetStorageDomainInfo), any())).thenReturn(returnValue);
// Execute command
getQuery().executeQueryCommand();
// Assert the query's results
List<StorageDomainStatic> returnedStorageDomainList = new ArrayList<>();
assertEquals(returnedStorageDomainList, getQuery().getQueryReturnValue().getReturnValue());
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class AbstractGetStorageDomainsWithAttachedStoragePoolGuidQueryTestCase method testAttachedStorageDomainWithStorageDomainsParameterQuery.
@Test
public void testAttachedStorageDomainWithStorageDomainsParameterQuery() {
StoragePool storagePool = new StoragePool();
storagePool.setStatus(StoragePoolStatus.Up);
mockStoragePoolDao(storagePool);
// Create parameters
List<StorageDomain> storageDomainList = new ArrayList<>();
storageDomainList.add(storageDomain);
StorageDomainsAndStoragePoolIdQueryParameters paramsMock = getQueryParameters();
when(paramsMock.getStorageDomainList()).thenReturn(storageDomainList);
// Run 'HSMGetStorageDomainInfo' command
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
Pair<StorageDomainStatic, Guid> storageDomainToPoolId = new Pair<>(storageDomain.getStorageStaticData(), Guid.newGuid());
returnValue.setReturnValue(storageDomainToPoolId);
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.HSMGetStorageDomainInfo), any())).thenReturn(returnValue);
// Execute command
getQuery().executeQueryCommand();
// Assert the query's results
List<StorageDomainStatic> returnedStorageDomainList = new ArrayList<>();
returnedStorageDomainList.add(storageDomain.getStorageStaticData());
assertEquals(returnedStorageDomainList, getQuery().getQueryReturnValue().getReturnValue());
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class GetStorageDomainsWithAttachedStoragePoolGuidQueryTest method testStoragePoolIsUninitializedButCheckBooleanIsFalse.
@Test
public void testStoragePoolIsUninitializedButCheckBooleanIsFalse() {
StoragePool storagePool = new StoragePool();
storagePool.setStatus(StoragePoolStatus.Uninitialized);
mockStoragePoolDao(storagePool);
// Create parameters
List<StorageDomain> storageDomainList = new ArrayList<>();
storageDomainList.add(storageDomain);
StorageDomainsAndStoragePoolIdQueryParameters paramsMock = getQueryParameters();
when(paramsMock.getStorageDomainList()).thenReturn(storageDomainList);
when(paramsMock.isCheckStoragePoolStatus()).thenReturn(Boolean.FALSE);
// Run 'HSMGetStorageDomainInfo' command
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
Pair<StorageDomainStatic, Guid> storageDomainToPoolId = new Pair<>(storageDomain.getStorageStaticData(), Guid.newGuid());
returnValue.setReturnValue(storageDomainToPoolId);
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.HSMGetStorageDomainInfo), any())).thenReturn(returnValue);
// Execute command
getQuery().executeQueryCommand();
// Assert the query's results
List<StorageDomainStatic> returnedStorageDomainList = new ArrayList<>();
returnedStorageDomainList.add(storageDomain.getStorageStaticData());
assertEquals(returnedStorageDomainList, getQuery().getQueryReturnValue().getReturnValue());
}
Aggregations