use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockMemQuotaSpecificInGrace.
/**
* Call by Guid: {@literal MEM_QUOTA_SPECIFIC_IN_GRACE}
*/
private Quota mockMemQuotaSpecificInGrace() {
Quota quota = mockBasicQuota();
quota.setId(MEM_QUOTA_SPECIFIC_IN_GRACE);
quota.setQuotaClusters(getQuotaClusters(UNLIMITED_VCPU, 0, 2048, 2100));
return quota;
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockMemQuotaSpecificNotExceeded.
// ///////////////////// Mem specific ////////////////////////////
/**
* Call by Guid: {@literal MEM_QUOTA_SPECIFIC_NOT_EXCEEDED}
*/
private Quota mockMemQuotaSpecificNotExceeded() {
Quota quota = mockBasicQuota();
quota.setId(MEM_QUOTA_SPECIFIC_NOT_EXCEEDED);
quota.setQuotaClusters(getQuotaClusters(UNLIMITED_VCPU, 0, 2048, 512));
return quota;
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockMemQuotaGlobalInGrace.
/**
* Call by Guid: {@literal MEM_QUOTA_GLOBAL_IN_GRACE}
*/
private Quota mockMemQuotaGlobalInGrace() {
Quota quota = mockBasicQuota();
quota.setId(MEM_QUOTA_GLOBAL_IN_GRACE);
quota.setGlobalQuotaCluster(getQuotaCluster(UNLIMITED_VCPU, 0, 2048, 2300));
return quota;
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockMemQuotaGlobalNotExceeded.
// ///////////////////// Mem global ////////////////////////////
/**
* Call by Guid: {@literal MEM_QUOTA_GLOBAL_NOT_EXCEEDED}
*/
private Quota mockMemQuotaGlobalNotExceeded() {
Quota quota = mockBasicQuota();
quota.setId(MEM_QUOTA_GLOBAL_NOT_EXCEEDED);
quota.setGlobalQuotaCluster(getQuotaCluster(UNLIMITED_VCPU, 0, 2048, 512));
return quota;
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockBasicQuota.
/**
* Mock a basic quota. Only the basic data (Id, name, threshold, grace...) is set.
*
* @return - basic quota with no limitations
*/
private Quota mockBasicQuota() {
dbCalls++;
// basic data
Quota quota = new Quota();
quota.setId(Guid.newGuid());
quota.setStoragePoolId(storage_pool.getId());
quota.setDescription("My Quota description");
quota.setQuotaName("My Quota Name");
quota.setGraceStoragePercentage(20);
quota.setGraceClusterPercentage(20);
quota.setThresholdStoragePercentage(80);
quota.setThresholdClusterPercentage(80);
// Enforcement type would be taken from the storage_pool and not from this field.
// But in case the storage_pool in null this enforcement will be considered.
quota.setQuotaEnforcementType(QuotaEnforcementTypeEnum.HARD_ENFORCEMENT);
return quota;
}
Aggregations