use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class UpdateStoragePoolCommandTest method newPoolNameIsAlreadyTaken.
private void newPoolNameIsAlreadyTaken() {
when(spDao.get(any())).thenReturn(new StoragePool());
List<StoragePool> storagePoolList = new ArrayList<>();
storagePoolList.add(createStoragePool());
when(spDao.getByName(any(), anyBoolean())).thenReturn(new ArrayList<>(storagePoolList));
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class UpdateStoragePoolCommandTest method hasLocalDomain.
@Test
public void hasLocalDomain() {
StorageDomainStatic sdc = new StorageDomainStatic();
sdc.setStorageType(StorageType.LOCALFS);
StoragePool existingSp = createStoragePool();
existingSp.setIsLocal(true);
when(spDao.get(any())).thenReturn(existingSp);
when(sdDao.getAllForStoragePool(any())).thenReturn(Collections.singletonList(sdc));
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_LOCAL);
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class DiskImagesValidatorTest method testIsQcowV3SupportedForDcVersionV4.
@Test
public void testIsQcowV3SupportedForDcVersionV4() {
disk1.setVolumeFormat(VolumeFormat.COW);
disk1.setQcowCompat(QcowCompat.QCOW2_V3);
StoragePool sp = new StoragePool();
sp.setStoragePoolFormatType(StorageFormatType.V4);
when(storagePoolDao.get(any())).thenReturn(sp);
assertThat(validator.isQcowVersionSupportedForDcVersion(), isValid());
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class DiskImagesValidatorTest method testIsQcowV2SupportedForDcVersionV3.
@Test
public void testIsQcowV2SupportedForDcVersionV3() {
disk1.setVolumeFormat(VolumeFormat.COW);
disk1.setQcowCompat(QcowCompat.QCOW2_V2);
StoragePool sp = new StoragePool();
sp.setStoragePoolFormatType(StorageFormatType.V3);
when(storagePoolDao.get(any())).thenReturn(sp);
assertThat(validator.isQcowVersionSupportedForDcVersion(), isValid());
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class AbstractSyncLunsCommandTest method testValidateStoragePoolStoragePoolNotUp.
@Test
public void testValidateStoragePoolStoragePoolNotUp() {
StoragePool storagePool = new StoragePool();
storagePool.setId(Guid.newGuid());
when(storagePoolDao.get(storagePool.getId())).thenReturn(storagePool);
command.setStoragePoolId(storagePool.getId());
assertFalse(command.validate());
ValidateTestUtils.assertValidationMessages("", command, EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL);
}
Aggregations