Open fchristian1992 opened 1 year ago
Hi @fchristian1992 This work meets the checkpoint 2 target. Looks like some progress here!
Following are my findings from a review for checkpoint 2:
Database designed and created
at least one DAO with full CRUD (create, read, update, delete) implemented with Hibernate
DAO is fully unit tested
[x] What purpose do these lines serve? https://github.com/fchristian1992/pcHardwareViewer/blob/5c45d09514dbfac40ed928318e5bb198ee740a4b/src/test/java/org/enterprise/persistence/UserDaoTest.java#L50-L51
[x] the delete scenario could be tested more fully to confirm if a user is deleted that the PCBuild is also deleted (assuming that is what should happen). Same thing with the "other" side. If a PCBuild is deleted, what happens to the user? Make sure what should happen, does happen via a unit test.
[x] Verifying the entities are saved/updated/inserted correctly can be more thorough by implementing and using equals() on each entity - refer to the video Comparing Hibernate Entities with equals in week 5 for more detail. An example of using that equals method in a unit test would be something like assertTrue(insertedPCBuild.equals(expectedPCBuild));
so that you don't have to compare each instance var/column manually like this: https://github.com/fchristian1992/pcHardwareViewer/blob/5c45d09514dbfac40ed928318e5bb198ee740a4b/src/test/java/org/enterprise/persistence/PcBuildDaoTest.java#L47
Log4J is implemented (no System.out.printlns)
other
Thanks for the feedback! Those 2 lines in the DAO tests you asked what were the purpose of are used to revert the database to what it was before the insert and the save/update tests to ensure I can run the tests in any order. However, now that I look at it, I guess it doesn't need to be in the delete test again... Other than that, you gave me some things to consider that I hadn't noticed or thought of, so I'll work on incorporating it all into my project.
@pawaitemadisoncollege please and thank you!