Liron Aravot has posted comments on this change.
Change subject: core: Add storage space validation to removeSnapshot
......................................................................
Patch Set 3: (4 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveSnapshotCommand.java
Line 188: }
Line 189:
Line 190: if (!isEnoughSpaceToMergeSnapshots()) {
Line 191: return false;
Line 192: }
you could just "return isEnoughSpaceToMergeSnapshots()"..will save few lines
and cleaner in my opinion
Line 193: }
Line 194:
Line 195: return true;
Line 196: }
Line 212: }
Line 213: storage_domains storageDomain =
Line 214:
getStorageDomainDAO().getForStoragePool(storageDomainId, getStoragePoolId());
Line 215: if (!validate(new
StorageDomainValidator(storageDomain).isDomainHasSpaceForRequest(sizeRequested,
false))) {
Line 216: return false;
return validate(new
StorageDomainValidator(storageDomain).isDomainHasSpaceForRequest(sizeR
equested, false)) - cleaner and shorter..
Line 217: }
Line 218: }
Line 219: return true;
Line 220: }
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveSnapshotCommandTest.java
Line 182: cmd.isEnoughSpaceToMergeSnapshots());
Line 183: }
Line 184:
Line 185: @Test
Line 186: public void
testNotEnoughForMultipleDiskAndDomainsSecondDomainFails() {
any difference between this test and the previous one?
Line 187: ArrayList<DiskImage> imagesDisks =
mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, 4);
Line 188: imagesDisks.addAll(mockMultipleSourceImagesForDomain(4,
STORAGE_DOMAIN_ID2, 4));
Line 189: doReturn(imagesDisks).when(cmd).getSourceImages();
Line 190: mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID);
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/StorageDomainValidatorTest.java
Line 79:
Line 80: @Test
Line 81: public void testDomainWithEnoughSpaceForRequestWithoutThreshold() {
Line 82: validator = new StorageDomainValidator(mockStorageDomain(12,
748, StorageType.NFS));
Line 83: assertTrue("Domain should have enough space for request.",
validator.isDomainHasSpaceForRequest(12, false)
those tests test the same..you need to change the paramater
Line 84: .isValid());
Line 85: }
Line 86:
Line 87: @Test
--
To view, visit http://gerrit.ovirt.org/11849
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifbebc5af8e7489bccfa5d8e79695fe21c5371ec9
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches