use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.
the class RefreshLunsSizeCommandTest method setUp.
@Before
public void setUp() {
StorageDomainStatic sdStatic = createStorageDomain();
spId = Guid.newGuid();
sd = new StorageDomain();
sd.setStorageStaticData(sdStatic);
sd.setStatus(StorageDomainStatus.Active);
sd.setStoragePoolId(spId);
StoragePool sp = new StoragePool();
sp.setId(spId);
sp.setStatus(StoragePoolStatus.Up);
sp.setIsLocal(false);
sp.setCompatibilityVersion(Version.v3_6);
doReturn(sd).when(cmd).getStorageDomain();
doReturn(sp).when(cmd).getStoragePool();
when(sdsDao.get(sdId)).thenReturn(sdStatic);
LUNs lun1 = new LUNs();
lun1.setLUNId("1");
lun1.setStorageDomainId(sdId);
LUNs lun2 = new LUNs();
lun2.setLUNId("2");
lun2.setStorageDomainId(sdId);
when(lunsDao.getAll()).thenReturn(Arrays.asList(lun1, lun2));
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.
the class RefreshLunsSizeCommandTest method validateWrongStorage.
@Test
public void validateWrongStorage() {
StorageDomainStatic nfsStatic = createStorageDomain();
nfsStatic.setStorageType(StorageType.NFS);
StorageDomain sd = new StorageDomain();
sd.setStorageStaticData(nfsStatic);
sd.setStatus(StorageDomainStatus.Active);
sd.setStoragePoolId(spId);
doReturn(sd).when(cmd).getStorageDomain();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.
the class AddExistingFileStorageDomainCommandTest method testSwitchStorageDomainType.
@Test
public void testSwitchStorageDomainType() {
StorageDomainStatic sdStatic = command.getStorageDomain().getStorageStaticData();
doReturn(new Pair<>(sdStatic, sdStatic.getId())).when(command).executeHSMGetStorageDomainInfo(any());
ValidateTestUtils.runAndAssertValidateSuccess(command);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.
the class AddStorageDomainCommonTest method validateFailsNameExists.
@Test
public void validateFailsNameExists() {
when(sdsDao.getByName(sd.getName())).thenReturn(new StorageDomainStatic());
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.
the class AttachStorageDomainToPoolCommandTest method mockGetStorageDomainInfoVdsCommand.
private void mockGetStorageDomainInfoVdsCommand(StorageDomainStatic storageDomain) {
Pair<StorageDomainStatic, Guid> pairResult = new Pair<>(storageDomain, null);
VDSReturnValue returnValueForGetStorageDomainInfo = new VDSReturnValue();
returnValueForGetStorageDomainInfo.setSucceeded(true);
returnValueForGetStorageDomainInfo.setReturnValue(pairResult);
when(vdsBrokerFrontend.runVdsCommand(eq(VDSCommandType.HSMGetStorageDomainInfo), any())).thenReturn(returnValueForGetStorageDomainInfo);
}
Aggregations