use of org.ovirt.engine.api.model.AffinityRule in project ovirt-engine by oVirt.
the class AffinityGroupMapperTest method testVmsRuleStructureDisabled.
@Test
public void testVmsRuleStructureDisabled() throws Exception {
AffinityGroup model = new AffinityGroup();
AffinityRule rule = new AffinityRule();
rule.setEnforcing(true);
rule.setPositive(false);
rule.setEnabled(false);
model.setVmsRule(rule);
org.ovirt.engine.core.common.scheduling.AffinityGroup entity = new org.ovirt.engine.core.common.scheduling.AffinityGroup();
AffinityGroupMapper.map(model, entity);
assertEquals(EntityAffinityRule.DISABLED, entity.getVmAffinityRule());
assertEquals(true, entity.isVmEnforcing());
assertEquals(false, entity.isVmAffinityEnabled());
}
use of org.ovirt.engine.api.model.AffinityRule in project ovirt-engine by oVirt.
the class AffinityGroupMapperTest method testHostsRuleStructure.
@Test
public void testHostsRuleStructure() throws Exception {
AffinityGroup model = new AffinityGroup();
AffinityRule rule = new AffinityRule();
rule.setEnabled(true);
rule.setEnforcing(true);
rule.setPositive(false);
model.setHostsRule(rule);
org.ovirt.engine.core.common.scheduling.AffinityGroup entity = new org.ovirt.engine.core.common.scheduling.AffinityGroup();
AffinityGroupMapper.map(model, entity);
assertEquals(EntityAffinityRule.NEGATIVE, entity.getVdsAffinityRule());
assertEquals(true, entity.isVdsEnforcing());
}
Aggregations