core: UpdateStorageDomainCommand's DAOs

Replaced calls to DbFacade.getInstance().getStorageDomainStaticDao()
with getStorageDomainStaticDAO(), as per the backend's convention.

This change is done in order to facilitate writing unit tests for this
class.

Change-Id: I716a662d13512331b4e68ca31a13b6fb559227cd
Signed-off-by: Allon Mureinik <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: StorageDomainManagementCommandBase's DAOs

Replaced call to DbFacade.getInstance().getStorageDomainStaticDao() with
getStorageDomainStaticDAO() as per the backend's convention.
This change is done in order to facilitate writing unit tests.

Change-Id: Ief680d1131104d28d9ec2850257bd84ff28fe5ad
Signed-off-by: Allon Mureinik <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>
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 <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: update SD's setActionMessageParameters

Moved the inclusion of VAR__ACTION__UPDATE in UpdateStorageDomainCommand
from canDoAction() to it's rightful place, setActionMessageParameters().

This patch also includes a basic test case that verifies the above
change was done correctly.

Change-Id: I98d9959cb79e3786e5fb51d50e1e1961e85bf629
Signed-off-by: Allon Mureinik <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: UpdateStorageDomain's CDA early return

Changed UpdateStorageDomainCommand.canDoAction() to use the early return
pattern in order to solve several NullPointerExceptions and enhance
readability.

Tests were added to all the canDoAction() flows to make sure these
changes did not break any functionality.

Change-Id: Iea10984090a759ef07da1fe572c4fdc323ede0e5
Signed-off-by: Allon Mureinik <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>
core: ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS

ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS' error message claims that
only a storage domain's name can be updated, but according to the code,
the name, description and comment can be updated.

This patch fixes this message accordingly.

Change-Id: Idf9049d0e47bcf3c96ccd73f70907dce2c47460b
Signed-off-by: Allon Mureinik <amureini@redhat.com>
Signed-off-by: Idan Shaby <ishaby@redhat.com>