Moti Asayag has posted comments on this change. Change subject: engine: Introduce VmNicDao ......................................................................
Patch Set 21: (7 comments) .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNicDaoDbFacadeImpl.java Line 57: } Line 58: Line 59: @Override Line 60: protected MapSqlParameterSource createFullParametersMapper(VmNic entity) { Line 61: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() Done Line 62: .addValue("id", entity.getId()) Line 63: .addValue("mac_addr", entity.getMacAddress()) Line 64: .addValue("name", entity.getName()) Line 65: .addValue("speed", entity.getSpeed()) .................................................... File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/VmNicDaoTest.java Line 14: import org.ovirt.engine.core.compat.Guid; Line 15: import org.ovirt.engine.core.dao.BaseDAOTestCase; Line 16: import org.ovirt.engine.core.dao.FixturesTool; Line 17: Line 18: public class VmNicDaoTest extends BaseDAOTestCase { Done Line 19: private static final Guid TEMPLATE_ID = new Guid("1b85420c-b84c-4f29-997e-0eb674b40b79"); Line 20: private static final Guid VM_ID = new Guid("77296e00-0cad-4e5a-9299-008a7b6f4355"); Line 21: Line 22: private VmNicDao dao; Line 16: import org.ovirt.engine.core.dao.FixturesTool; Line 17: Line 18: public class VmNicDaoTest extends BaseDAOTestCase { Line 19: private static final Guid TEMPLATE_ID = new Guid("1b85420c-b84c-4f29-997e-0eb674b40b79"); Line 20: private static final Guid VM_ID = new Guid("77296e00-0cad-4e5a-9299-008a7b6f4355"); Done Line 21: Line 22: private VmNicDao dao; Line 23: Line 24: private VmNic existingVmNic; Line 32: dao = dbFacade.getVmNicDao(); Line 33: existingVmNic = dao.get(FixturesTool.VM_NETWORK_INTERFACE); Line 34: existingTemplateNic = dao.get(FixturesTool.TEMPLATE_NETWORK_INTERFACE); Line 35: Line 36: newVmNic = new VmNetworkInterface(); Done Line 37: newVmNic.setId(Guid.newGuid()); Line 38: newVmNic.setVnicProfileId(FixturesTool.VM_NETWORK_INTERFACE_PROFILE); Line 39: newVmNic.setName("eth77"); Line 40: newVmNic.setLinked(true); Line 183: assertEquals(FixturesTool.MAC_ADDRESS, vmNetworkInterface.getMacAddress()); Line 184: } Line 185: } Line 186: Line 187: private void assertCorrectResultForTemplate(List<VmNic> result) { Done Line 188: assertNotNull(result); Line 189: assertFalse(result.isEmpty()); Line 190: for (VmNic iface : result) { Line 191: assertEquals(TEMPLATE_ID, iface.getVmTemplateId()); .................................................... File packaging/dbscripts/network_sp.sql Line 501: END; $procedure$ Line 502: LANGUAGE plpgsql; Line 503: Line 504: Line 505: Create or replace FUNCTION GetVmInterfaceByVmInterfaceId(v_id UUID) RETURNS SETOF vm_interface we should address refactoring this file into a more granular content latter on. I guess we'd rather split this into network_vds, network_vm, ... if at all... Line 506: AS $procedure$ Line 507: BEGIN Line 508: RETURN QUERY SELECT * Line 509: FROM vm_interface Line 572: ---------------------------------------------------------------- Line 573: -- VM Interface View Line 574: ---------------------------------------------------------------- Line 575: Line 576: Create or replace FUNCTION GetAllFromvm_interface() RETURNS SETOF vm_interface_view just testing if the "replace" part of "Create or replace" behaves properly ;-) I've organized this file a bit so it would be easier to distinguish between the various entities and probably it was copied once more that needed. Line 577: AS $procedure$ Line 578: BEGIN Line 579: RETURN QUERY SELECT * Line 580: FROM vm_interface_view; -- To view, visit http://gerrit.ovirt.org/17178 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d1ff6dfc415915244367c153ffc064ddd0d0df Gerrit-PatchSet: 21 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches