Hello Idan Shaby,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/29807

to review the following change.

Change subject: core: Check messages when CDA succeeds
......................................................................

core: Check messages when CDA succeeds

Improved CanDoActionTestUtils.runAndAssertCanDoActionSuccess to check
not only that canDoAction() returned true, but also that it did not add
any messages to the return value.

Change-Id: I72d4ee52679db995aba9155c71954c13be613fa4
Signed-off-by: Allon Mureinik <[email protected]>
Signed-off-by: Idan Shaby <[email protected]>
---
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CanDoActionTestUtils.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/29807/1

diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CanDoActionTestUtils.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CanDoActionTestUtils.java
index c31f4b3..1419c12 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CanDoActionTestUtils.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CanDoActionTestUtils.java
@@ -57,8 +57,11 @@
      */
     public static void runAndAssertCanDoActionSuccess(CommandBase<?> command) {
         boolean canDoAction = command.canDoAction();
+        List<String> canDoActionMessages = 
command.getReturnValue().getCanDoActionMessages();
         assertTrue(MessageFormat.format("Command''s canDoAction expected to 
succeed, but failed, messages are: {0}",
-                command.getReturnValue().getCanDoActionMessages()), 
canDoAction);
+                canDoActionMessages), canDoAction);
+        assertTrue(MessageFormat.format("Command''s canDoAction succeeded, but 
added the following messages: {0}",
+                canDoActionMessages), canDoActionMessages.isEmpty());
     }
 
     /**


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72d4ee52679db995aba9155c71954c13be613fa4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Idan Shaby <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to