Idan Shaby has posted comments on this change.

Change subject: core: add more tests to MemoryStorageHandlerTest
......................................................................


Patch Set 4:

(7 comments)

https://gerrit.ovirt.org/#/c/40436/4/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/MemoryStorageHandlerTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/MemoryStorageHandlerTest.java:

Line 70:     }
Line 71: 
Line 72:     @Test
Line 73:     public void testFindStorageDomainForMemoryWithSingleDomain() {
Line 74:         verifyDomainForMemory(Arrays.asList(validStorageDomain));
> Please use Collections.singletonList()
Done
Line 75:     }
Line 76: 
Line 77:     @Test
Line 78:     public void testFindStorageDomainForMemoryWithEmptyDomainsList() {


Line 75:     }
Line 76: 
Line 77:     @Test
Line 78:     public void testFindStorageDomainForMemoryWithEmptyDomainsList() {
Line 79:         verifyNoDomainForMemory(new ArrayList<StorageDomain>());
> Why not Collections.emptyList() ?
Done
Line 80:     }
Line 81: 
Line 82:     @Test
Line 83:     public void 
testFindStorageDomainForMemoryWithSingleInvalidDomain() {


Line 80:     }
Line 81: 
Line 82:     @Test
Line 83:     public void 
testFindStorageDomainForMemoryWithSingleInvalidDomain() {
Line 84:         verifyNoDomainForMemory(Arrays.asList(invalidStorageDomain1));
> Please use Collections.singletonList()
Done
Line 85:     }
Line 86: 
Line 87:     @Test
Line 88:     public void verifyNoDomainForMemoryWhenDomainIsNotDataDomain() {


Line 88:     public void verifyNoDomainForMemoryWhenDomainIsNotDataDomain() {
Line 89:         for (StorageDomainType storageDomainType : 
StorageDomainType.values()) {
Line 90:             if (!storageDomainType.isDataDomain()) {
Line 91:                 
validStorageDomain.setStorageDomainType(storageDomainType);
Line 92:                 
verifyNoDomainForMemory(Arrays.asList(validStorageDomain));
> Please use Collections.singletonList()
Done
Line 93:             }
Line 94:         }
Line 95:     }
Line 96: 


Line 98:     public void verifyNoDomainForMemoryWhenDomainIsNotActive() {
Line 99:         for (StorageDomainStatus storageDomainStatus : 
StorageDomainStatus.values()) {
Line 100:             if (storageDomainStatus != StorageDomainStatus.Active) {
Line 101:                 validStorageDomain.setStatus(storageDomainStatus);
Line 102:                 
verifyNoDomainForMemory(Arrays.asList(validStorageDomain));
> Please use Collections.singletonList()
Done
Line 103:             }
Line 104:         }
Line 105:     }
Line 106: 


Line 107:     @Test
Line 108:     public void verifyNoDomainForMemoryWhenDomainHasLowSpace() {
Line 109:         when(validStorageDomainValidator.isDomainWithinThresholds())
Line 110:                 .thenReturn(new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN));
Line 111:         verifyNoDomainForMemory(Arrays.asList(validStorageDomain));
> Please use Collections.singletonList()
Done
Line 112:     }
Line 113: 
Line 114:     @Test
Line 115:     public void 
verifyNoDomainForMemoryWhenDomainHasNoSpaceForClonedDisks() {


Line 114:     @Test
Line 115:     public void 
verifyNoDomainForMemoryWhenDomainHasNoSpaceForClonedDisks() {
Line 116:         
when(validStorageDomainValidator.hasSpaceForClonedDisks(anyCollectionOf(DiskImage.class)))
Line 117:                 .thenReturn(new 
ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN));
Line 118:         verifyNoDomainForMemory(Arrays.asList(validStorageDomain));
> Please use Collections.singletonList()
Done
Line 119:     }
Line 120: 
Line 121:     private void initStorageDomains() {
Line 122:         validStorageDomain = initStorageDomain();


-- 
To view, visit https://gerrit.ovirt.org/40436
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5ff159f0482872844b274f2c5b20b171e08e8b08
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ish...@redhat.com>
Gerrit-Reviewer: Ala Hino <ah...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Candace Sheremeta <csher...@redhat.com>
Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com>
Gerrit-Reviewer: Idan Shaby <ish...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to