use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainsResourceTest method testAddIncompleteNfsStorageParameters.
@Test
public void testAddIncompleteNfsStorageParameters() throws Exception {
StorageDomain model = getModel(0);
model.setName(NAMES[0]);
model.setHost(new Host());
model.getHost().setId(GUIDS[0].toString());
model.setStorage(new HostStorage());
model.getStorage().setType(StorageType.NFS);
model.getStorage().setPath(PATHS[0]);
setUriInfo(setUpBasicUriExpectations());
try {
collection.add(model);
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "HostStorage", "add", "address");
}
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainsResourceTest method getModel.
static StorageDomain getModel(int index) {
StorageDomain model = new StorageDomain();
model.setName(getSafeEntry(index, NAMES));
model.setDescription(getSafeEntry(index, DESCRIPTIONS));
model.setType(getSafeEntry(index, TYPES));
model.setStorage(new HostStorage());
model.getStorage().setType(getSafeEntry(index, STORAGE_TYPES));
model.getStorage().setAddress(getSafeEntry(index, ADDRESSES));
model.getStorage().setPath(getSafeEntry(index, PATHS));
model.getStorage().setMountOptions(getSafeEntry(index, MOUNT_OPTIONS));
model.getStorage().setVfsType(getSafeEntry(index, VFS_TYPES));
return model;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainsResourceTest method doTestBadCnxAdd.
private void doTestBadCnxAdd(boolean valid, boolean success, String detail) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.AddStorageServerConnection, StorageServerConnectionParametersBase.class, new String[] { "StorageServerConnection.Connection", "StorageServerConnection.StorageType", "VdsId" }, new Object[] { ADDRESSES[0] + ":" + PATHS[0], STORAGE_TYPES_MAPPED[0], GUIDS[0] }, valid, success, GUIDS[0].toString(), true));
StorageDomain model = getModel(0);
model.setHost(new Host());
model.getHost().setId(GUIDS[0].toString());
try {
collection.add(model);
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendVmDiskResourceTest method setUpMoveParams.
private Action setUpMoveParams(boolean byName) {
Action action = new Action();
StorageDomain sd = new StorageDomain();
if (byName) {
sd.setName(NAMES[2]);
} else {
sd.setId(GUIDS[3].toString());
}
action.setStorageDomain(sd);
return action;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainDiskResourceTest method testExport.
@Test
public void testExport() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ExportRepoImage, ExportRepoImageParameters.class, new String[] { "ImageGroupID", "DestinationDomainId" }, new Object[] { DISK_ID, GUIDS[3] }, true, true, null, null, true));
Action action = new Action();
action.setStorageDomain(new StorageDomain());
action.getStorageDomain().setId(GUIDS[3].toString());
verifyActionResponse(resource.export(action));
}
Aggregations