use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendVmsResourceTest method addStorageDomainToModel.
private void addStorageDomainToModel(Vm model) {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(GUIDS[1].toString());
model.setStorageDomain(storageDomain);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testExportWithStorageDomainName.
@Test
public void testExportWithStorageDomainName() throws Exception {
setUpEntityQueryExpectations(QueryType.GetStorageDomainByName, NameQueryParameters.class, new String[] { "Name" }, new Object[] { NAMES[2] }, getStorageDomainStatic(2));
StorageDomain storageDomain = new StorageDomain();
storageDomain.setName(NAMES[2]);
doTestExport(storageDomain, false, false);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfilesResourceTest method testAddDiskProfile.
@Test
public void testAddDiskProfile() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpStorageDomainQueryExpectations();
setUpCreationExpectations(ActionType.AddDiskProfile, DiskProfileParameters.class, new String[] {}, new Object[] {}, true, true, GUIDS[0], QueryType.GetDiskProfileById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { Guid.Empty }, getEntity(0));
DiskProfile model = getModel(0);
model.setStorageDomain(new StorageDomain());
model.getStorageDomain().setId(STORAGE_DOMAIN_ID.toString());
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof DiskProfile);
verifyModel((DiskProfile) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfilesResourceTest method doTestBadAddDiskProfile.
private void doTestBadAddDiskProfile(boolean valid, boolean success, String detail) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.AddDiskProfile, DiskProfileParameters.class, new String[] {}, new Object[] {}, valid, success));
DiskProfile model = getModel(0);
model.setStorageDomain(new StorageDomain());
model.getStorageDomain().setId(STORAGE_DOMAIN_ID.toString());
try {
collection.add(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendDisksResourceTest method getModel.
static Disk getModel() {
Disk model = new Disk();
model.setProvisionedSize(1024 * 1024L);
model.setFormat(DiskFormat.COW);
model.setSparse(true);
model.setShareable(false);
model.setPropagateErrors(true);
model.setStorageDomains(new StorageDomains());
model.getStorageDomains().getStorageDomains().add(new StorageDomain());
model.getStorageDomains().getStorageDomains().get(0).setId(GUIDS[2].toString());
return model;
}
Aggregations