Allon Mureinik has posted comments on this change.

Change subject: core: New tests for AddVmTemplateCommand
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

http://gerrit.ovirt.org/#/c/34555/1//COMMIT_MSG
Commit Message:

Line 12: alias. This patch adds tests to AddVmTemplateCommandTest to verify
Line 13: that this will be disabled at the backend level.
Line 14: 
Line 15: Change-Id: I614239c750096b1c3585e0e56bc0d77d328e4c8f
Line 16: Bug-Url: https://bugzilla.redhat.com/1110304
This patch does not solve this bug, so "Bug-Url" should not be used. You can 
either use "Relates-To:", or just drop this line altogether.


http://gerrit.ovirt.org/#/c/34555/1/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java:

Line 168:         assertFalse("Pattern-based name should not be supported for 
Template", cmd.validateInputs());
Line 169:     }
Line 170: 
Line 171:     @Test
Line 172:     public void testEmptyDiskAlias() {
This function has three different cases - it should probably be broken into 
three different functions.
Line 173:         Map<Guid, Disk> diskInfoDestinationMap = new HashMap();
Line 174:         vm.setDiskMap(diskInfoDestinationMap);
Line 175:         DiskImage disk1 = new DiskImage();
Line 176:         DiskImage disk2 = new DiskImage();


Line 169:     }
Line 170: 
Line 171:     @Test
Line 172:     public void testEmptyDiskAlias() {
Line 173:         Map<Guid, Disk> diskInfoDestinationMap = new HashMap();
Don't use raw types - "new HashMap<>()"
Line 174:         vm.setDiskMap(diskInfoDestinationMap);
Line 175:         DiskImage disk1 = new DiskImage();
Line 176:         DiskImage disk2 = new DiskImage();
Line 177:         disk1.setDiskAlias("");


Line 190:         assertFalse(cmd.isDisksAliasNotEmpty());
Line 191: 
Line 192:         disk1.setDiskAlias("");
Line 193:         disk2.setDiskAlias("alias");
Line 194:         assertFalse(cmd.isDisksAliasNotEmpty());
I'd also add a test where isDiskAliasNotEmpty returns true.
Line 195:     }
Line 196: 
Line 197:     private void setupForStorageTests() {
Line 198:         doReturn(true).when(cmd).validateVmNotDuringSnapshot();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I614239c750096b1c3585e0e56bc0d77d328e4c8f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Idan Shaby <ish...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to