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;
}
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());
}
}
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());
}
}
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;
}
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);
}
Aggregations