use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainTemplateResourceTest method testImportWithStorageDomainName.
@Test
public void testImportWithStorageDomainName() throws Exception {
setUpEntityQueryExpectations(QueryType.GetStorageDomainByName, NameQueryParameters.class, new String[] { "Name" }, new Object[] { NAMES[2] }, getStorageDomainStatic(2));
setUpGetDataCenterByStorageDomainExpectations(STORAGE_DOMAIN_ID);
StorageDomain storageDomain = new StorageDomain();
storageDomain.setName(NAMES[2]);
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setId(GUIDS[1].toString());
doTestImport(storageDomain, cluster, false);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainTemplateResourceTest method testImport.
@Test
public void testImport() throws Exception {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(GUIDS[2].toString());
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setId(GUIDS[1].toString());
setUpGetDataCenterByStorageDomainExpectations(STORAGE_DOMAIN_ID);
doTestImport(storageDomain, cluster, false);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainTemplateResourceTest method doTestImportAsync.
private void doTestImportAsync(AsyncTaskStatusEnum asyncStatus, CreationStatus actionStatus) throws Exception {
setUpGetEntityExpectations(1, StorageDomainType.ImportExport, GUIDS[2]);
setUpGetDataCenterByStorageDomainExpectations(GUIDS[3]);
setUriInfo(setUpActionExpectations(ActionType.ImportVmTemplate, ImportVmTemplateParameters.class, new String[] { "ContainerId", "StorageDomainId", "SourceDomainId", "DestDomainId", "StoragePoolId", "ClusterId" }, new Object[] { TEMPLATE_ID, GUIDS[2], STORAGE_DOMAIN_ID, GUIDS[2], DATA_CENTER_ID, GUIDS[1] }, asList(GUIDS[1]), asList(new AsyncTaskStatus(asyncStatus))));
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(GUIDS[2].toString());
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setId(GUIDS[1].toString());
Action action = new Action();
action.setStorageDomain(storageDomain);
action.setCluster(cluster);
Response response = resource.doImport(action);
verifyActionResponse(response, URL_BASE, true, null);
action = (Action) response.getEntity();
assertTrue(action.isSetStatus());
assertEquals(actionStatus.value(), action.getStatus());
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainTemplateResourceTest method testImportAsNewEntity.
@Test
public void testImportAsNewEntity() throws Exception {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(GUIDS[2].toString());
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setId(GUIDS[1].toString());
setUpGetDataCenterByStorageDomainExpectations(STORAGE_DOMAIN_ID);
doTestImport(storageDomain, cluster, true);
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendStorageDomainTemplateResourceTest method testImportWithClusterName.
@Test
public void testImportWithClusterName() throws Exception {
setUpEntityQueryExpectations(QueryType.GetClusterByName, NameQueryParameters.class, new String[] { "Name" }, new Object[] { NAMES[1] }, getCluster(1));
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(GUIDS[2].toString());
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setName(NAMES[1]);
setUpGetDataCenterByStorageDomainExpectations(STORAGE_DOMAIN_ID);
doTestImport(storageDomain, cluster, false);
}
Aggregations