use of org.ovirt.engine.core.common.businessentities.VmTemplate in project ovirt-engine by oVirt.
the class VmTemplateDaoTest method testGetWithPermissionsDisabledForUnpriviligedUser.
/**
* Asserts that the right template is returned for a non privileged user with filtering disabled
*/
@Test
public void testGetWithPermissionsDisabledForUnpriviligedUser() {
VmTemplate result = dao.get(FixturesTool.VM_TEMPLATE_RHEL5, UNPRIVILEGED_USER_ID, false);
assertGetResult(result);
}
use of org.ovirt.engine.core.common.businessentities.VmTemplate in project ovirt-engine by oVirt.
the class VmTemplateDaoTest method testGetAllForCluster.
/**
* Ensures that the templates for the given vds group are returned.
*/
@Test
public void testGetAllForCluster() {
List<VmTemplate> result = dao.getAllForCluster(FixturesTool.CLUSTER);
assertGetAllResult(result);
for (VmTemplate template : result) {
assertEquals(FixturesTool.CLUSTER, template.getClusterId());
}
}
use of org.ovirt.engine.core.common.businessentities.VmTemplate in project ovirt-engine by oVirt.
the class VmTemplateDaoTest method testGetWithPermissionsForPriviligedUser.
/**
* Asserts that the right template is returned for a privileged user with filtering enabled
*/
@Test
public void testGetWithPermissionsForPriviligedUser() {
VmTemplate result = dao.get(FixturesTool.VM_TEMPLATE_RHEL5, PRIVILEGED_USER_ID, true);
assertGetResult(result);
}
use of org.ovirt.engine.core.common.businessentities.VmTemplate in project ovirt-engine by oVirt.
the class VmTemplateDaoTest method generateNewEntity.
@Override
protected VmTemplate generateNewEntity() {
VmTemplate newVmTemplate = new VmTemplate();
newVmTemplate.setId(Guid.newGuid());
newVmTemplate.setName("NewVmTemplate");
newVmTemplate.setClusterId(FixturesTool.CLUSTER);
newVmTemplate.setClusterArch(ArchitectureType.x86_64);
newVmTemplate.setCpuProfileId(FixturesTool.CPU_PROFILE_2);
newVmTemplate.setSmallIconId(FixturesTool.SMALL_ICON_ID);
newVmTemplate.setLargeIconId(FixturesTool.LARGE_ICON_ID);
return newVmTemplate;
}
use of org.ovirt.engine.core.common.businessentities.VmTemplate in project ovirt-engine by oVirt.
the class VmDaoTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
dao = dbFacade.getVmDao();
existingVm = dao.get(FixturesTool.VM_RHEL5_POOL_57);
existingVm.setStatus(VMStatus.Up);
VmTemplate vmtemplate = dbFacade.getVmTemplateDao().get(FixturesTool.VM_TEMPLATE_RHEL5);
existingTemplate = dbFacade.getVmTemplateDao().get(FixturesTool.VM_TEMPLATE_RHEL5);
VM newVm = new VM();
newVm.setId(Guid.newGuid());
newVm.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI);
newVm.setVmtGuid(vmtemplate.getId());
VmStatic newVmStatic = new VmStatic();
newVmStatic.setName("New Virtual Machine");
newVmStatic.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI);
newVmStatic.setVmtGuid(vmtemplate.getId());
}
Aggregations