use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class MacPoolDaoTest method testGetByClusterId.
@Test
public void testGetByClusterId() throws Exception {
final Guid notExistingRecordGuid = Guid.newGuid();
final MacPool macPool = dao.getByClusterId(notExistingRecordGuid);
assertThat(macPool, nullValue());
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class MacPoolDaoTest method generateNewEntity.
@Override
protected MacPool generateNewEntity() {
final MacPool macPool = new MacPool();
macPool.setId(Guid.newGuid());
macPool.setName("someName");
macPool.setAllowDuplicateMacAddresses(true);
macPool.setDescription("someDesc");
macPool.setDefaultPool(false);
final MacRange macRange = new MacRange();
macRange.setMacPoolId(macPool.getId());
macRange.setMacFrom("01:c0:81:21:71:17");
macRange.setMacTo("01:c1:81:21:71:17");
macPool.getRanges().add(macRange);
return macPool;
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class MacPoolDaoTest method testMacPoolGetByClusterIdExist.
@Test
public void testMacPoolGetByClusterIdExist() throws Exception {
final MacPool macPool = dao.getByClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI);
assertThat(macPool, notNullValue());
assertThat(macPool.getId(), is(FixturesTool.NON_DEFAULT_MAC_POOL));
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class UpdateMacPoolCommandTest method testValidateDefaultFlagIsNotChangedWhenFlagChanged.
@Test
public void testValidateDefaultFlagIsNotChangedWhenFlagChanged() throws Exception {
final MacPool macPool1 = new MacPool();
final MacPool macPool2 = new MacPool();
macPool2.setDefaultPool(!macPool1.isDefaultPool());
assertThat(UpdateMacPoolCommand.validateDefaultFlagIsNotChanged(macPool1, macPool2), failsWith(EngineMessage.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED));
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class GetMacPoolByIdQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
final MacPool macPool = macPoolDao.get(getParameters().getId());
getQueryReturnValue().setReturnValue(macPool);
}
Aggregations