Mike Kolesnik has posted comments on this change. Change subject: DO NOT SUBMIT core: Adding new query ......................................................................
Patch Set 19: (10 inline comments) .................................................... File backend/manager/dbscripts/snapshots_sp.sql Line 166: WHERE user_id = v_user_id AND entity_id = (SELECT vm_id Please remove TWS Line 167: FROM snapshots where snapshot_id = v_snapshot_id))); Please use spaces not tabs .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmConfigurationBySnapshotQuery.java Line 61: getDiskImageDao().getAllSnapshotsForVmSnapshot(getParameters().getSnapshotSourceId()); Maybe it would be more robust to check just by IDs, to reduce possibility of bugs Line 90: private static Log log = LogFactory.getLog(GetVmConfigurationBySnapshotQuery.class); No need to define log here .................................................... File backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetVmConfigurationBySnapshotQueryTest.java Line 69: snapshot.setCreationDate(GregorianCalendar.getInstance().getTime()); Umm you could just use "new Date()" Line 70: snapshot.setStatus(SnapshotStatus.OK); Basically I don't see why you instantiate all these fields since other than the vm config none of them is used. Line 87: // Mock the DAOs Please fix indentation Line 109: }).when(snapshotsManager).updateVmFromConfiguration(any(VM.class),any(String.class)); Why is this important? You can just verify that the call to updateVmFromConfiguration was made Line 149: }).when(executeQuery).getVmFromConfiguration(any(String.class)); What is this checking? Shouldn't you be checking that vm from configuration contains an image that is not in the DB.. ? .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetVmConfigurationBySnapshotQueryParams.java Line 7: private Guid snapshotSourceId; Isn't sourceSnapshotId a better name? Or better yet, simply snapshotId ? -- To view, visit http://gerrit.ovirt.org/2295 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3155134ff9ad89bb50ec4baa8fd393844f80bb32 Gerrit-PatchSet: 19 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: Maor Lipchuk <[email protected]> Gerrit-Reviewer: Mike Kolesnik <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
