Search in sources :

Example 16 with PolicyUnit

use of org.ovirt.engine.core.common.scheduling.PolicyUnit in project ovirt-engine by oVirt.

the class PolicyUnitDaoTest method testGetNegative.

@Test
public void testGetNegative() {
    PolicyUnit result = dao.get(Guid.newGuid());
    assertNull(result);
}
Also used : PolicyUnit(org.ovirt.engine.core.common.scheduling.PolicyUnit) Test(org.junit.Test)

Example 17 with PolicyUnit

use of org.ovirt.engine.core.common.scheduling.PolicyUnit in project ovirt-engine by oVirt.

the class PolicyUnitDaoTest method createDummyPolicyUnit.

private void createDummyPolicyUnit() {
    dummyPolicyUnit = new PolicyUnit();
    dummyPolicyUnit.setId(Guid.newGuid());
    dummyPolicyUnit.setName("Dummy policy unit");
    dummyPolicyUnit.setDescription("Description");
    dummyPolicyUnit.setPolicyUnitType(PolicyUnitType.FILTER);
    dummyPolicyUnit.setParameterRegExMap(new LinkedHashMap<>());
}
Also used : PolicyUnit(org.ovirt.engine.core.common.scheduling.PolicyUnit)

Example 18 with PolicyUnit

use of org.ovirt.engine.core.common.scheduling.PolicyUnit in project ovirt-engine by oVirt.

the class PolicyUnitDaoTest method testGet.

@Test
public void testGet() {
    PolicyUnit result = dao.get(FixturesTool.POLICY_UNIT_MIGRATION);
    assertEquals(result, existingPolicyUnit);
}
Also used : PolicyUnit(org.ovirt.engine.core.common.scheduling.PolicyUnit) Test(org.junit.Test)

Example 19 with PolicyUnit

use of org.ovirt.engine.core.common.scheduling.PolicyUnit in project ovirt-engine by oVirt.

the class PolicyUnitDaoTest method testSave.

@Test
public void testSave() {
    dao.save(dummyPolicyUnit);
    PolicyUnit result = dao.get(dummyPolicyUnit.getId());
    assertEquals(result, dummyPolicyUnit);
}
Also used : PolicyUnit(org.ovirt.engine.core.common.scheduling.PolicyUnit) Test(org.junit.Test)

Example 20 with PolicyUnit

use of org.ovirt.engine.core.common.scheduling.PolicyUnit in project ovirt-engine by oVirt.

the class PolicyUnitDaoTest method testUpdate.

@Test
public void testUpdate() {
    PolicyUnit policyUnitToUpdate = dao.get(FixturesTool.POLICY_UNIT_MIGRATION);
    Map<String, String> map = new LinkedHashMap<>();
    map.put("A", "B");
    policyUnitToUpdate.setParameterRegExMap(map);
    policyUnitToUpdate.setDescription("dummy description");
    dao.update(policyUnitToUpdate);
    PolicyUnit result = dao.get(policyUnitToUpdate.getId());
    assertEquals(result, policyUnitToUpdate);
}
Also used : PolicyUnit(org.ovirt.engine.core.common.scheduling.PolicyUnit) LinkedHashMap(java.util.LinkedHashMap) Test(org.junit.Test)

Aggregations

PolicyUnit (org.ovirt.engine.core.common.scheduling.PolicyUnit)24 Guid (org.ovirt.engine.core.compat.Guid)7 ArrayList (java.util.ArrayList)6 LinkedHashMap (java.util.LinkedHashMap)5 HashMap (java.util.HashMap)4 Test (org.junit.Test)4 ClusterPolicy (org.ovirt.engine.core.common.scheduling.ClusterPolicy)4 HashSet (java.util.HashSet)2 RankSelectorPolicyUnit (org.ovirt.engine.core.bll.scheduling.policyunits.RankSelectorPolicyUnit)2 Pair (org.ovirt.engine.core.common.utils.Pair)2 FunctionPolicyUnitPanel (org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.panels.FunctionPolicyUnitPanel)2 ImageResource (com.google.gwt.resources.client.ImageResource)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 Column (com.google.gwt.user.cellview.client.Column)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Map (java.util.Map)1