Search in sources :

Example 11 with CpuProfile

use of org.ovirt.engine.core.common.businessentities.profiles.CpuProfile in project ovirt-engine by oVirt.

the class CpuProfileDaoTest method generateNewEntity.

@Override
protected CpuProfile generateNewEntity() {
    CpuProfile cpuProfile = new CpuProfile();
    cpuProfile.setId(Guid.newGuid());
    cpuProfile.setName("new_profile");
    cpuProfile.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI);
    cpuProfile.setQosId(FixturesTool.QOS_ID_4);
    return cpuProfile;
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile)

Example 12 with CpuProfile

use of org.ovirt.engine.core.common.businessentities.profiles.CpuProfile in project ovirt-engine by oVirt.

the class CpuProfileDaoTest method checkResults.

private void checkResults(List<CpuProfile> result) {
    assertNotNull(result);
    assertEquals(2, result.size());
    for (CpuProfile cpuProfile : result) {
        assertEquals(FixturesTool.CLUSTER_RHEL6_ISCSI, cpuProfile.getClusterId());
    }
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile)

Example 13 with CpuProfile

use of org.ovirt.engine.core.common.businessentities.profiles.CpuProfile in project ovirt-engine by oVirt.

the class CpuProfileDaoTest method testGetByQos.

@Test
public void testGetByQos() {
    List<CpuProfile> allForQos = dao.getAllForQos(FixturesTool.QOS_ID_4);
    assertNotNull(allForQos);
    assertEquals(2, allForQos.size());
    for (CpuProfile cpuProfile : allForQos) {
        assertEquals(FixturesTool.QOS_ID_4, cpuProfile.getQosId());
    }
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) Test(org.junit.Test)

Example 14 with CpuProfile

use of org.ovirt.engine.core.common.businessentities.profiles.CpuProfile in project ovirt-engine by oVirt.

the class BaseVmListModelTest method mockCpuProfiles.

protected ListModel<CpuProfile> mockCpuProfiles() {
    CpuProfile cpuProfile = new CpuProfile();
    cpuProfile.setId(CPU_PROFILE_ID);
    final ListModel<CpuProfile> model = mockListModel(cpuProfile);
    when(model.getIsAvailable()).thenReturn(true);
    return model;
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile)

Example 15 with CpuProfile

use of org.ovirt.engine.core.common.businessentities.profiles.CpuProfile in project ovirt-engine by oVirt.

the class CpuProfileBaseModel method flush.

@Override
public void flush() {
    if (getProfile() == null) {
        setProfile(new CpuProfile());
    }
    CpuProfile cpuProfile = getProfile();
    cpuProfile.setName(getName().getEntity());
    cpuProfile.setDescription(getDescription().getEntity());
    Cluster cluster = getParentListModel().getSelectedItem();
    cpuProfile.setClusterId(cluster != null ? cluster.getId() : null);
    CpuQos cpuQos = getQos().getSelectedItem();
    cpuProfile.setQosId(cpuQos != null && cpuQos.getId() != null && !cpuQos.getId().equals(Guid.Empty) ? cpuQos.getId() : null);
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) CpuQos(org.ovirt.engine.core.common.businessentities.qos.CpuQos) Cluster(org.ovirt.engine.core.common.businessentities.Cluster)

Aggregations

CpuProfile (org.ovirt.engine.core.common.businessentities.profiles.CpuProfile)20 Guid (org.ovirt.engine.core.compat.Guid)5 VM (org.ovirt.engine.core.common.businessentities.VM)4 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)4 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 Test (org.junit.Test)3 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)3 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)3 HashMap (java.util.HashMap)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)2 CpuProfileParameters (org.ovirt.engine.core.common.action.CpuProfileParameters)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2 Quota (org.ovirt.engine.core.common.businessentities.Quota)2 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)2 CpuQos (org.ovirt.engine.core.common.businessentities.qos.CpuQos)2 RepoImage (org.ovirt.engine.core.common.businessentities.storage.RepoImage)2 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 ImportVmFromExternalProviderParameters (org.ovirt.engine.core.common.action.ImportVmFromExternalProviderParameters)1 ImportVmFromOvaParameters (org.ovirt.engine.core.common.action.ImportVmFromOvaParameters)1