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