use of org.ovirt.engine.api.model.ExternalVmImport in project ovirt-engine by oVirt.
the class BackendExternalVmImportsResourceTest method createVmImport.
private ExternalVmImport createVmImport() {
File file = new File();
file.setId(DRIVERS_ISO);
ExternalVmImport vmImport = new ExternalVmImport();
vmImport.setName(EXTERNAL_VM_NAME);
vmImport.setVm(new Vm());
vmImport.getVm().setName(CREATED_VM_NAME);
vmImport.setCluster(new Cluster());
vmImport.getCluster().setId(CLUSTER_ID.toString());
vmImport.setStorageDomain(new StorageDomain());
vmImport.getStorageDomain().setId(STORAGE_DOMAIN_ID.toString());
vmImport.setHost(new Host());
vmImport.getHost().setId(HOST_ID.toString());
vmImport.setSparse(true);
vmImport.setProvider(ExternalVmProviderType.VMWARE);
vmImport.setDriversIso(file);
vmImport.setUsername(USERNAME);
vmImport.setPassword(PASSWORD);
vmImport.setUrl(VMWARE_URL);
return vmImport;
}
use of org.ovirt.engine.api.model.ExternalVmImport in project ovirt-engine by oVirt.
the class BackendExternalVmImportsResourceTest method testVmWareImport.
@Test
public void testVmWareImport() {
VM externalVm = new VM();
externalVm.setName(EXTERNAL_VM_NAME);
setUpActionExpectations(ActionType.ImportVmFromExternalUrl, ImportVmFromExternalUrlParameters.class, new String[] { "OriginType", "StorageDomainId", "ClusterId", "Url", "Username", "Password", "ProxyHostId", "VirtioIsoName", "ExternalName", "VolumeType", "NewVmName" }, new Object[] { ORIGIN_TYPE, STORAGE_DOMAIN_ID, CLUSTER_ID, VMWARE_URL, USERNAME, PASSWORD, HOST_ID, DRIVERS_ISO, EXTERNAL_VM_NAME, VOLUME_TYPE, CREATED_VM_NAME }, true, true, externalVm, true);
ExternalVmImport vmImport = createVmImport();
resource.add(vmImport);
}
Aggregations