Alona Kaplan has posted comments on this change.

Change subject: engine: Refactor AttachNetworksToClusterCommand
......................................................................


Patch Set 9:

(6 comments)

http://gerrit.ovirt.org/#/c/33684/9/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/SetManagementNetworkFirstParameterComparator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/SetManagementNetworkFirstParameterComparator.java:

Line 1: package org.ovirt.engine.core.bll.network.cluster;
> Please move to org.ovirt.engine.core.common.businessentities.comparators
Or even to org.ovirt.engine.ui.uicommonweb.Linq if you'll move the sort logic 
to the ui.
Line 2: 
Line 3: import static org.apache.commons.lang.BooleanUtils.toInteger;
Line 4: 
Line 5: import java.util.Comparator;


http://gerrit.ovirt.org/#/c/33684/9/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/cluster/AttachNetworkToClusterCommandTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/cluster/AttachNetworkToClusterCommandTest.java:

Line 65:         underTest = new 
AttachNetworkToClusterCommand<AttachNetworkToVdsGroupParameter>(param);
Line 66:     }
Line 67: 
Line 68:     private void initializeDbFacadeMocks() {
Line 69:         DbFacadeLocator.setDbFacade(mockDbFacade);
As I wrote and explained in the previous patches- please don't use the locator.
Line 70:         when(mockDbFacade.getNetworkDao()).thenReturn(mockNetworkDao);
Line 71:         
when(mockDbFacade.getNetworkClusterDao()).thenReturn(mockNetworkClusterDao);
Line 72:         
when(mockDbFacade.getVdsGroupDao()).thenReturn(mockVdsGroupDAO);
Line 73:     }


http://gerrit.ovirt.org/#/c/33684/9/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/cluster/SetManagementNetworkFirstParameterComparatorTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/cluster/SetManagementNetworkFirstParameterComparatorTest.java:

Line 14: import org.ovirt.engine.core.common.businessentities.network.Network;
Line 15: import 
org.ovirt.engine.core.common.businessentities.network.NetworkCluster;
Line 16: 
Line 17: @RunWith(MockitoJUnitRunner.class)
Line 18: public class SetManagementNetworkFirstParameterComparatorTest {
I'm not sure you still need the comparator. Added comments in case you'll still 
somehow use it:)
Line 19: 
Line 20:     @Mock
Line 21:     private AttachNetworkToVdsGroupParameter 
mockAttachNetworkToVdsGroupParameter1;
Line 22:     @Mock


Line 48:         testCompareNoNulls(true, false, -1);
Line 49:     }
Line 50: 
Line 51:     @Test
Line 52:     public void compareEq1() {
maybe- compareEqTrue?
Line 53:         testCompareNoNulls(true, true, 0);
Line 54:     }
Line 55: 
Line 56:     @Test


Line 53:         testCompareNoNulls(true, true, 0);
Line 54:     }
Line 55: 
Line 56:     @Test
Line 57:     public void compareEq2() {
maybe- compareEqFalse?
Line 58:         testCompareNoNulls(false, false, 0);
Line 59:     }
Line 60: 
Line 61:     @Test


Line 58:         testCompareNoNulls(false, false, 0);
Line 59:     }
Line 60: 
Line 61:     @Test
Line 62:     public void compareWithNulls1() {
1. Please give more informative name than 1 and 2.
2. Please add comment bofore each test or split it to smaller tests with 
informative name.
Line 63:         assertEquals(0, 
underTest.compare(mockAttachNetworkToVdsGroupParameter1, 
mockAttachNetworkToVdsGroupParameter2));
Line 64:         
when(mockAttachNetworkToVdsGroupParameter1.getNetwork()).thenReturn(mockNetwork1);
Line 65:         assertEquals(0, 
underTest.compare(mockAttachNetworkToVdsGroupParameter1, 
mockAttachNetworkToVdsGroupParameter2));
Line 66:         
when(mockNetwork1.getCluster()).thenReturn(mockNetworkCluster1);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a0b86d8bb018a6172891cb357a4402cfef135d1
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to