Allon Mureinik has posted comments on this change.
Change subject: core: Fix Remove Storage error message(#863097)
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java
Line 149:
Line 150: @Override
Line 151: protected boolean canDoAction() {
Line 152: return super.canDoAction();
Line 153: }
Now that this method only calls super, and can safely be removed.
Line 154:
Line 155: protected boolean checkStorageDomainNameLengthValid() {
Line 156: boolean result = true;
Line 157: if (getStorageDomain().getstorage_name().length() > Config
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommandTest.java
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());
Line 54: command.setActionMessageParameters();
This should not be done in this test - it tests only the canDoAction function.
You should have another, new, test for the setActionMessageParameters() method.
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(),
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
Line 85: checkSucceeded(cmd, false);
Line 86: cmd.setActionMessageParameters();
Line 87: checkMessages(cmd,
Line 88: VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN,
Line 89: VdcBllMessages.VAR__ACTION__REMOVE);
here too - a test for canDoAction should not look at the VAR__TYPE* messages.
Line 90: }
Line 91:
Line 92: @Test
Line 93: public void testRemoveNfsData() {
--
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