Mike Kolesnik has posted comments on this change.

Change subject: core: Query GetVdsGroupsByNetworkId (WIP)
......................................................................


Patch Set 1: (3 inline comments)

Please add DAO tests

....................................................
File backend/manager/dbscripts/vds_groups_sp.sql
Line 182: --This SP returns all clusters that the given network is assigned to
Line 183: Create or replace FUNCTION GetVdsGroupsByNetworkId(v_network_id UUID) 
RETURNS SETOF vds_groups
Line 184:    AS $procedure$
Line 185: BEGIN
Line 186:       RETURN QUERY SELECT *
Shouldn't you be querying just for vds_groups.* ?
Line 187:       FROM vds_groups
Line 188:       INNER JOIN network_cluster
Line 189:       ON vds_groups.vds_group_id = network_cluster.cluster_id
Line 190:       WHERE (network_id = v_network_id);


Line 186:       RETURN QUERY SELECT *
Line 187:       FROM vds_groups
Line 188:       INNER JOIN network_cluster
Line 189:       ON vds_groups.vds_group_id = network_cluster.cluster_id
Line 190:       WHERE (network_id = v_network_id);
Parentheses are not required here..
Line 191: END; $procedure$
Line 192: LANGUAGE plpgsql;
Line 193: 
Line 194: 


....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetVdsGroupsByNetworkIdQueryTest.java
Line 30: 
Line 31:         // Set up the DAOs
Line 32:         VDSGroup cluster = new VDSGroup();
Line 33:         List<VDSGroup> expected = Collections.singletonList(cluster);
Line 34:         VdsGroupDAO VdsGroupDAOMock = mock(VdsGroupDAO.class);
Should be named vdsGroupDAOMock (I would also go with Dao wince it's more 
readable, but that's up to you)
Line 35:         
when(VdsGroupDAOMock.getAllForNetwork(networkId)).thenReturn(expected);
Line 36:         
when(getDbFacadeMockInstance().getVdsGroupDao()).thenReturn(VdsGroupDAOMock);
Line 37: 
Line 38:         // Run the query


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5602c19e731cf0c3fe1377a574eac9ac42d351b6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Muli Salem <msa...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to