Gilad Chaplik has posted comments on this change. Change subject: core, db: Introduce BaseProfile and DiskProfile ......................................................................
Patch Set 16: (8 comments) new patch to follow. http://gerrit.ovirt.org/#/c/27099/16/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/profiles/ProfileBaseDaoFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/profiles/ProfileBaseDaoFacadeImpl.java: Line 12: Line 13: public abstract class ProfileBaseDaoFacadeImpl<T extends ProfileBase> extends DefaultGenericDaoDbFacade<T, Guid> implements ProfilesDao<T> { Line 14: protected final RowMapper<T> mapper = createEntityRowMapper(); Line 15: Line 16: public ProfileBaseDaoFacadeImpl(ProfileType profileType, String entityStoredProcedureName) { > why do we get here the profile type if it's never used? Done Line 17: super(entityStoredProcedureName); Line 18: } Line 19: Line 20: @Override http://gerrit.ovirt.org/#/c/27099/16/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/profiles/DiskProfileDaoTest.java File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/profiles/DiskProfileDaoTest.java: Line 69: public void testGetAllForStorageDomainFull() { Line 70: List<DiskProfile> result = dao.getAllForStorageDomain(FixturesTool.STORAGE_DOAMIN_SCALE_SD5); Line 71: Line 72: assertNotNull(result); Line 73: assertEquals(2, result.size()); > erhaps also add an iternation over the received profiles here and verify th Done Line 74: } Line 75: Line 76: /** Line 77: * Ensures that an empty collection is returned. Line 73: assertEquals(2, result.size()); Line 74: } Line 75: Line 76: /** Line 77: * Ensures that an empty collection is returned. > comment is wrong Done Line 78: */ Line 79: @Test Line 80: public void testGetAll() { Line 81: List<DiskProfile> result = dao.getAll(); Line 89: */ Line 90: @Test Line 91: public void testSave() { Line 92: dao.save(diskProfile); Line 93: DiskProfile result = dao.get(diskProfile.getId()); > let's add assertion at first the dao.get(...) is null Done Line 94: assertNotNull(result); Line 95: assertEquals(diskProfile, result); Line 96: } Line 97: Line 99: * Ensures that the update is working correctly Line 100: */ Line 101: @Test Line 102: public void testUpdate() { Line 103: dao.save(diskProfile); > - let's change something between the save and the update, Done Line 104: dao.update(diskProfile); Line 105: DiskProfile result = dao.get(diskProfile.getId()); Line 106: assertNotNull(result); Line 107: assertEquals(diskProfile, result); Line 111: * Ensures that the remove is working correctly Line 112: */ Line 113: @Test Line 114: public void testRemove() { Line 115: dao.save(diskProfile); > - let's remove one of the profile that you added, no need to save a new one * the order of test isn't deterministic., prefer to save and remove. * line 118 Line 116: DiskProfile result = dao.get(diskProfile.getId()); Line 117: assertNotNull(result); Line 118: dao.remove(diskProfile.getId()); Line 119: assertNull(dao.get(diskProfile.getId())); http://gerrit.ovirt.org/#/c/27099/16/backend/manager/modules/dal/src/test/resources/fixtures.xml File backend/manager/modules/dal/src/test/resources/fixtures.xml: Line 4980: <value>77296e00-0cad-4e5a-9299-008a7b6f4354</value> Line 4981: </row> Line 4982: </table> Line 4983: Line 4984: <table name="disk_profiles"> > from what i've seen, only one of this records is being used. testGetAll.count = 5 Line 4985: <column>id</column> Line 4986: <column>name</column> Line 4987: <column>storage_domain_id</column> Line 4988: <column>qos_id</column> http://gerrit.ovirt.org/#/c/27099/16/packaging/dbscripts/upgrade/03_05_0770_add_disk_profiles_table.sql File packaging/dbscripts/upgrade/03_05_0770_add_disk_profiles_table.sql: Line 2: -- table disk_profiles Line 3: --------------------------------------------------------------------- Line 4: CREATE TABLE disk_profiles Line 5: ( Line 6: id UUID CONSTRAINT pk_disk_profiles_id PRIMARY KEY, > you can just have here Done Line 7: name VARCHAR(50) NOT NULL, Line 8: storage_domain_id UUID NOT NULL, Line 9: qos_id UUID, Line 10: description TEXT, -- To view, visit http://gerrit.ovirt.org/27099 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I229af59277b5055453188f002f19046cdd51d63b Gerrit-PatchSet: 16 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Eli Mesika <elimes...@gmail.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Kobi Ianko <k...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org 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