Allon Mureinik has posted comments on this change.

Change subject: core: QuotaManager Test - test1
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)

IMO, this test is structured wrong.

You have numerous logical situations there, and the failure to handle one will 
prevent you from testing the rest.
Each one of these should be in it's own method, so they don't interfere with 
each other.

....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/QuotaManagerTest.java
Line 138:         List<StorageQuotaValidationParameter> parameters = new 
ArrayList<StorageQuotaValidationParameter>();
Line 139: 
Line 140:         parameters.add(new 
StorageQuotaValidationParameter(STORAGE_QUOTA_GLOBAL_NOT_EXCEEDED, 
destinationGuid, 1));
Line 141:         boolean res = 
quotaManager.validateAndSetStorageQuota(storage_pool, parameters, 
canDoActionMessages);
Line 142:         assertTrue(res);
Suppose this assert fails for some reason...
Line 143:         assertEmpty(canDoActionMessages);
Line 144:         parameters.clear();
Line 145:         canDoActionMessages.clear();
Line 146: 


Line 144:         parameters.clear();
Line 145:         canDoActionMessages.clear();
Line 146: 
Line 147:         parameters.add(new 
StorageQuotaValidationParameter(STORAGE_QUOTA_GLOBAL_OVER_THRESHOLD, 
destinationGuid, 1));
Line 148:         
assertTrue(quotaManager.validateAndSetStorageQuota(storage_pool, parameters, 
canDoActionMessages));
... then you'll never get here.
You'll be sniffing out bugs one at a time instead of paralleled.
Line 149:         assertEmpty(canDoActionMessages);
Line 150:         parameters.clear();
Line 151:         canDoActionMessages.clear();
Line 152: 


--
To view, visit http://gerrit.ovirt.org/8439
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I374769dfcc4bb99de2e578d4267fb03484d9c63f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to