use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class BlockStorageDiscardFunctionalityHelperTest method createStorageDomain.
private void createStorageDomain() {
storageDomain = new StorageDomain();
storageDomain.setId(Guid.newGuid());
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class DiskValidatorTest method canCopyDiskFails.
@Test
public void canCopyDiskFails() {
StorageDomain domain = createStorageDomainForDisk(StorageType.ISCSI);
domain.setStorageFormat(StorageFormatType.V3);
disk.setSize(1000);
DiskImage child = createDiskImage();
child.setSize(1000);
child.setStorageIds(Collections.singletonList(domain.getId()));
DiskImage parent = createDiskImage();
parent.setId(Guid.newGuid());
parent.setSize(500);
parent.setStorageIds(Collections.singletonList(domain.getId()));
child.setParentId(parent.getParentId());
List<DiskImage> diskImages = new ArrayList<>(2);
diskImages.add(parent);
diskImages.add(child);
when(validator.getDiskImageDao().getAllSnapshotsForImageGroup(disk.getId())).thenReturn(diskImages);
assertThat(diskImagesValidator.childDiskWasExtended(domain), failsWith(EngineMessage.CANNOT_MOVE_DISK_SNAPSHOTS));
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class DiskVmElementDiscardSupportValidatorTest method initDiskStorageDomain.
private void initDiskStorageDomain(StorageType storageType, Boolean sdSupportsDiscard) {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setStorageName(storageDomainName);
storageDomain.setStorageType(storageType);
storageDomain.setSupportsDiscard(sdSupportsDiscard);
storageDomainId = Guid.newGuid();
storageDomain.setId(storageDomainId);
initMocks(this);
injectorRule.bind(StorageDomainDao.class, storageDomainDao);
when(storageDomainDao.get(storageDomainId)).thenReturn(storageDomain);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class MultipleStorageDomainsValidatorTest method setUp.
@Before
public void setUp() {
Guid spId = Guid.newGuid();
sdId1 = Guid.newGuid();
sdId2 = Guid.newGuid();
sdId3 = Guid.newGuid();
domain1 = new StorageDomain();
domain1.setId(sdId1);
domain1.setStoragePoolId(spId);
domain2 = new StorageDomain();
domain2.setId(sdId2);
domain2.setStoragePoolId(spId);
domain3 = new StorageDomain();
domain3.setId(sdId3);
domain3.setStoragePoolId(spId);
when(dao.getForStoragePool(sdId1, spId)).thenReturn(domain1);
when(dao.getForStoragePool(sdId2, spId)).thenReturn(domain2);
when(dao.getForStoragePool(sdId3, spId)).thenReturn(domain3);
validator = spy(new MultipleStorageDomainsValidator(spId, Arrays.asList(sdId1, sdId2, sdId3)));
doReturn(dao).when(validator).getStorageDomainDao();
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class StorageConnectionValidatorTest method setUp.
@Before
public void setUp() {
connection = new StorageServerConnections();
connection.setId(CONNECTION_ID_FOR_VALIDATION);
connection.setStorageType(StorageType.ISCSI);
validator = spy(new StorageConnectionValidator(connection));
domain = new StorageDomain();
domain.setStorageType(StorageType.ISCSI);
domain.setId(Guid.newGuid());
domain.setStatus(StorageDomainStatus.Maintenance);
domain.setStorageDomainSharedStatus(StorageDomainSharedStatus.Inactive);
}
Aggregations