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

Method remove

ch4/CommentServiceImplTest.java:25–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 BoardDao boardDao;
24
25 @Test
26 public void remove() throws Exception {
27 boardDao.deleteAll();
28
29 BoardDto boardDto = new BoardDto("hello", "hello", "asdf");
30 assertTrue(boardDao.insert(boardDto) == 1);
31 Integer bno = boardDao.selectAll().get(0).getBno();
32 System.out.println("bno = " + bno);
33
34 commentDao.deleteAll(bno);
35 CommentDto commentDto = new CommentDto(bno,0,"hi","qwer");
36
37 assertTrue(boardDao.select(bno).getComment_cnt() == 0);
38 assertTrue(commentService.write(commentDto)==1);
39 assertTrue(boardDao.select(bno).getComment_cnt() == 1);
40
41 Integer cno = commentDao.selectAll(bno).get(0).getCno();
42
43 // 일부러 예외를 발생시키고 Tx가 취소되는지 확인해야.
44 int rowCnt = commentService.remove(cno, bno, commentDto.getCommenter());
45 assertTrue(rowCnt==1);
46 assertTrue(boardDao.select(bno).getComment_cnt() == 0);
47 }
48
49 @Test
50 public void write() throws Exception {

Callers

nothing calls this directly

Calls 10

getCommenterMethod · 0.95
getComment_cntMethod · 0.80
getCnoMethod · 0.80
deleteAllMethod · 0.65
insertMethod · 0.65
selectAllMethod · 0.65
selectMethod · 0.65
writeMethod · 0.65
removeMethod · 0.65
getBnoMethod · 0.45

Tested by

no test coverage detected