Changeset 1635 for ComponentRegistry/branches/jeaferversion/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/impl/database/CommentsDaoTest.java
- Timestamp:
- 12/01/11 15:04:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/jeaferversion/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/impl/database/CommentsDaoTest.java
r1633 r1635 43 43 @Test 44 44 public void testInsertComment() { 45 Comment testComment = createTestComment();45 Comment comment = createTestComment(); 46 46 47 47 48 48 49 String regDate = Comment.createNewDate();50 49 51 50 //testComment.setId(TEST_COMMENT_ID); 52 testComment.setComment("test");53 // testComment.setUserID("1");51 52 //comment.setUserId("1"); 54 53 //testComment.setComponentDescriptionId("A component1"); 55 54 //testComment.setProfileDescriptionId("A profile1"); 56 testComment.setCommentDate(regDate);57 55 56 String testComment = comment.getComment(); 58 57 assertEquals(0, commentsDao.getAllComments().size()); 59 Number newId = commentsDao.insertComment( testComment);58 Number newId = commentsDao.insertComment(comment, testComment, Integer.parseInt(TEST_COMMENT_USER_ID)); 60 59 assertNotNull(newId); 61 60 62 61 List<Comment> comments = commentsDao.getAllComments(); 62 assertNotNull(comments); 63 63 assertEquals(1, comments.size()); 64 64 65 65 assertEquals(TEST_COMMENT_NAME, comments.get(0).getComment()); 66 66 // assertEquals("A component1", comments.get(0).getComponentDescriptionId()); 67 //assertEquals("A profile1", comments.get(0).getProfileDescriptionId());68 assertEquals( regDate, comments.get(0).getCommentDate());69 // assertEquals("1", comments.get(0).getUserId());70 //assertEquals(TEST_COMMENT_ID, comments.get(0).getId());67 assertEquals(TEST_COMMENT_PROFILE_ID, comments.get(0).getProfileDescriptionId()); 68 assertEquals(TEST_COMMENT_DATE, comments.get(0).getCommentDate()); 69 assertEquals(TEST_COMMENT_USER_ID, comments.get(0).getUserId()); 70 //assertEquals(TEST_COMMENT_ID, comments.get(0).getId()); 71 71 } 72 72 … … 90 90 @Test 91 91 public void testGetComment() { 92 Comment testComment = createTestComment(); 93 commentsDao.insertComment(testComment); 92 Comment comment = createTestComment(); 93 String testComment = comment.getComment(); 94 commentsDao.insertComment(comment, testComment, 8); 94 95 95 96 assertNotNull(commentsDao.getByComment(TEST_COMMENT_NAME)); … … 109 110 110 111 public void testSetDelete(){ 111 Comment testComment = createTestComment(); 112 Comment comment = createTestComment(); 113 String testComment = comment.getComment(); 112 114 int count = commentsDao.getAllComments().size(); 113 115 114 commentsDao.insertComment( testComment);116 commentsDao.insertComment(comment, testComment, 8); 115 117 assertEquals(count + 1, commentsDao.getAllComments().size()); 116 118 117 commentsDao.deleteComment( testComment, true);119 commentsDao.deleteComment(comment, true); 118 120 assertEquals(count, commentsDao.getAllComments().size()); 119 121
Note: See TracChangeset
for help on using the changeset viewer.