MCPcopy Index your code
hub / github.com/castello/spring_basic / update

Method update

ch4/CommentDaoImplTest.java:78–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 @Test
79 public void update() throws Exception {
80 commentDao.deleteAll(1);
81 CommentDto commentDto = new CommentDto(1, 0, "comment", "asdf");
82 assertTrue(commentDao.insert(commentDto)==1);
83 assertTrue(commentDao.count(1)==1);
84
85 List<CommentDto> list = commentDao.selectAll(1);
86 commentDto.setCno(list.get(0).getCno());
87 commentDto.setComment("comment2");
88 assertTrue(commentDao.update(commentDto)==1);
89
90 list = commentDao.selectAll(1);
91 String comment = list.get(0).getComment();
92 String commenter = list.get(0).getCommenter();
93 assertTrue(comment.equals(commentDto.getComment()));
94 assertTrue(commenter.equals(commentDto.getCommenter()));
95 }
96}

Callers

nothing calls this directly

Calls 11

setCnoMethod · 0.95
setCommentMethod · 0.95
getCommentMethod · 0.95
getCommenterMethod · 0.95
getCnoMethod · 0.80
deleteAllMethod · 0.65
insertMethod · 0.65
countMethod · 0.65
selectAllMethod · 0.65
updateMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected