use of org.ovirt.engine.core.common.businessentities.Cluster 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.core.common.businessentities.Cluster 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.core.common.businessentities.Cluster 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.core.common.businessentities.Cluster 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);
}
use of org.ovirt.engine.core.common.businessentities.Cluster in project ovirt-engine by oVirt.
the class BackendStorageDomainVmResourceTest 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, false, true);
}
Aggregations