Search in sources :

Example 31 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class GetUnregisteredBlockStorageDomainsQueryTest method createGetStorageDomainInfoReturnValue.

private VDSReturnValue createGetStorageDomainInfoReturnValue() {
    VDSReturnValue returnValue = new VDSReturnValue();
    returnValue.setSucceeded(true);
    StorageDomain storageDomain = new StorageDomain();
    storageDomain.setId(storageDomainId);
    Pair<StorageDomainStatic, Object> pair = new Pair<>(storageDomain.getStorageStaticData(), null);
    returnValue.setReturnValue(pair);
    return returnValue;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 32 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class RefreshLunsSizeCommandTest method createStorageDomain.

private StorageDomainStatic createStorageDomain() {
    StorageDomainStatic sd = new StorageDomainStatic();
    sd.setId(sdId);
    sd.setStorageName("newStorageDomain");
    sd.setComment("a storage domain for testing");
    sd.setDescription("a storage domain for testing");
    sd.setStorageDomainType(StorageDomainType.Data);
    sd.setStorageType(StorageType.ISCSI);
    sd.setStorageFormat(StorageFormatType.V3);
    sd.setStorage(STORAGE);
    return sd;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic)

Example 33 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class UpdateStorageDomainCommandTest method setUp.

@Before
public void setUp() {
    StorageDomainStatic oldSdStatic = createStorageDomain();
    Guid spId = Guid.newGuid();
    sd = new StorageDomain();
    sd.setId(sdId);
    sd.setStorageStaticData(cmd.getParameters().getStorageDomain());
    sd.setStatus(StorageDomainStatus.Active);
    sd.setStoragePoolId(spId);
    sp = new StoragePool();
    sp.setId(spId);
    sp.setStatus(StoragePoolStatus.Up);
    sp.setIsLocal(false);
    doReturn(sd).when(cmd).getStorageDomain();
    doReturn(sp).when(cmd).getStoragePool();
    when(sdsDao.get(sdId)).thenReturn(oldSdStatic);
    mockStorageDomainValidator();
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) Guid(org.ovirt.engine.core.compat.Guid) Before(org.junit.Before)

Example 34 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class UpdateStorageDomainCommandTest method createStorageDomain.

private StorageDomainStatic createStorageDomain() {
    StorageDomainStatic sd = new StorageDomainStatic();
    sd.setId(sdId);
    sd.setStorageName("newStorageDomain");
    sd.setComment("a storage domain for testing");
    sd.setDescription("a storage domain for testing");
    sd.setStorageDomainType(StorageDomainType.Data);
    sd.setStorageType(StorageType.NFS);
    sd.setStorageFormat(StorageFormatType.V3);
    return sd;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic)

Example 35 with StorageDomainStatic

use of org.ovirt.engine.core.common.businessentities.StorageDomainStatic in project ovirt-engine by oVirt.

the class UpdateStorageDomainCommandTest method validateChangeNameExists.

@Test
public void validateChangeNameExists() {
    String newName = StringUtils.reverse(sd.getStorageName());
    sd.setStorageName(newName);
    doReturn(new StorageDomainStatic()).when(sdsDao).getByName(newName);
    ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST);
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) Test(org.junit.Test) BaseCommandTest(org.ovirt.engine.core.bll.BaseCommandTest)

Aggregations

StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)92 Guid (org.ovirt.engine.core.compat.Guid)39 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)35 ArrayList (java.util.ArrayList)33 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)31 Test (org.junit.Test)23 Pair (org.ovirt.engine.core.common.utils.Pair)19 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)18 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)15 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)14 List (java.util.List)13 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)13 StorageDomainManagementParameter (org.ovirt.engine.core.common.action.StorageDomainManagementParameter)13 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)13 VDS (org.ovirt.engine.core.common.businessentities.VDS)12 HashSet (java.util.HashSet)11 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)11 ActionType (org.ovirt.engine.core.common.action.ActionType)11 AttachStorageDomainToPoolParameters (org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters)10