Search in sources :

Example 16 with MacPool

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());
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) Guid(org.ovirt.engine.core.compat.Guid) Test(org.junit.Test)

Example 17 with MacPool

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;
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) MacRange(org.ovirt.engine.core.common.businessentities.MacRange)

Example 18 with 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));
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) Test(org.junit.Test)

Example 19 with MacPool

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));
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool) Test(org.junit.Test)

Example 20 with MacPool

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);
}
Also used : MacPool(org.ovirt.engine.core.common.businessentities.MacPool)

Aggregations

MacPool (org.ovirt.engine.core.common.businessentities.MacPool)20 Test (org.junit.Test)8 Guid (org.ovirt.engine.core.compat.Guid)5 ArrayList (java.util.ArrayList)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 MacRange (org.ovirt.engine.core.common.businessentities.MacRange)3 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 MacPoolParameters (org.ovirt.engine.core.common.action.MacPoolParameters)1 RemoveMacPoolByIdParameters (org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 NewSharedMacPoolModel (org.ovirt.engine.ui.uicommonweb.models.macpool.NewSharedMacPoolModel)1 SharedMacPoolModel (org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel)1