Allon Mureinik has posted comments on this change.

Change subject: engine: test for AddVdsCommand
......................................................................


Patch Set 5: Looks good to me, but someone else must approve

(3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
Line 279: 
Line 280:     boolean validateVdsGroup() {
Line 281:         if (getVdsGroup() == null) {
Line 282:             
addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID);
Line 283:             return false;
you can use return failCanDoAction
Line 284:         }
Line 285:         return true;
Line 286:     }
Line 287: 


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVdsCommandTest.java
Line 13: import org.ovirt.engine.core.dao.VdsGroupDAO;
Line 14: import org.ovirt.engine.core.utils.MockConfigRule;
Line 15: 
Line 16: public class AddVdsCommandTest {
Line 17:     private VDS makeTestVds(Guid vdsId) {
could be static
Line 18:         VDS newVdsData = new VDS();
Line 19:         newVdsData.setHostName("BUZZ");
Line 20:         newVdsData.setVdsName("BAR");
Line 21:         newVdsData.setVdsGroupCompatibilityVersion(new 
Version("1.2.3"));


Line 48:         
Mockito.when(commandMock.getVdsGroupDAO()).thenReturn(groupDAOMock);
Line 49: 
Line 50:         VdsDAO vdsDaoMock = Mockito.mock(VdsDAO.class);
Line 51:         Mockito.when(vdsDaoMock.get(vdsId)).thenReturn(null);
Line 52:         // Mockito.when(vdsDaoMock.get(vdsId)).thenReturn(null);
I'm guessing this is here by mistake?
Line 53:         Mockito.when(commandMock.getVdsDAO()).thenReturn(vdsDaoMock);
Line 54:         Mockito.when(commandMock.validateVdsGroup()).thenReturn(true);
Line 55:         
Mockito.when(commandMock.validateSingleHostAttachedToLocalStorage()).thenReturn(true);
Line 56:         
Mockito.when(commandMock.isPowerManagementLegal()).thenReturn(true);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaa8b31e3bb4f96e34d7ea7e97ec8c4c5b1f19984
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhorn...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to