Liron Aravot has posted comments on this change.

Change subject: core: Fix Remove Storage error message(#863097)
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java
Line 145:     @Override
Line 146:     protected void setActionMessageParameters() {
Line 147:         
addCanDoActionMessage(VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN);
Line 148:     }
Line 149: 
canDoAction method is unneeded now...
Line 150:     @Override
Line 151:     protected boolean canDoAction() {
Line 152:         return super.canDoAction();
Line 153:     }


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommandTest.java
Line 49:     @Test
Line 50:     public void testCanDoActionNonExistingStorageDomain() {
Line 51:         // All the mock DAOs return nulls (which mocks the objects do 
not exist)
Line 52:         // canDoAction should return false, not crash with 
NullPointerExcpetion
Line 53:         assertFalse("canDoActtion shouldn't be possible for a 
non-existant storage domain", command.canDoAction());
shouldn't it be called automatically?
Line 54:         command.setActionMessageParameters();
Line 55:         List<String> messages = 
command.getReturnValue().getCanDoActionMessages();
Line 56:         assertEquals("Wrong number of messages", 3, messages.size());
Line 57:         assertEquals("Wrong message",


Line 54:         command.setActionMessageParameters();
Line 55:         List<String> messages = 
command.getReturnValue().getCanDoActionMessages();
Line 56:         assertEquals("Wrong number of messages", 3, messages.size());
Line 57:         assertEquals("Wrong message",
Line 58:                 
VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name(),
seems to me that instead of those 3 lines it will be better to compare the 
collections using CollectionUtils.isEqualCollection.

if you don't agree, the assert message might be changed to give more 
information.
Line 59:                 messages.get(0));
Line 60:         assertEquals("Wrong message",
Line 61:                 VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN.name(),
Line 62:                 messages.get(1));


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
Line 81: 
Line 82:         RemoveStorageDomainCommand<RemoveStorageDomainParameters> cmd 
= createCommand(true);
Line 83:         assertTrue(cmd.canDoAction());
Line 84: 
Line 85:         checkSucceeded(cmd, false);
isn't it called automatically?
Line 86:         cmd.setActionMessageParameters();
Line 87:         checkMessages(cmd,
Line 88:                 VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN,
Line 89:                 VdcBllMessages.VAR__ACTION__REMOVE);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8b737545c0519cc2034bb6eec36afcc38da26059
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to