@Test @DataSet("XiaoChun.DataSet.xls") public void addBoard() throws Exception { Board board = XlsDataSetBeanFactory.createBean(ForumServiceTest.class, "XiaoChun.DataSet.xls", "t_board", Board.class); forumService.addBoard(board); Board boardDb = forumService.getBoardById(board.getBoardId()); assertEquals(boardDb.getBoardName(), equalTo("育儿")); }
public void addBoard(Board board) { boardDao.save(board); }
ForumService { public void addBoard(Board board) { boardDao.save(board); } }
ForumService { public void addBoard(Board board) { boardDao.save(board); }  }
ForumService { public void addBoard(Board board) { boardDao.save(board); }  @Autowired void setTopicDao(TopicDao topicDao); @Autowired void setUserDao(UserDao userDao); @Autowired void setBoardDao(BoardDao boardDao); @Autowired void setPostDao(PostDao postDao); void addTopic(Topic topic); void removeTopic(int topicId); void addPost(Post post); void removePost(int postId); void addBoard(Board board); void removeBoard(int boardId); void makeDigestTopic(int topicId); List<Board> getAllBoards(); Page getPagedTopics(int boardId,int pageNo,int pageSize); Page getPagedPosts(int topicId,int pageNo,int pageSize); Page queryTopicByTitle(String title,int pageNo,int pageSize); Board getBoardById(int boardId); Topic getTopicByTopicId(int topicId); Post getPostByPostId(int postId); void addBoardManager(int boardId,String userName); void updateTopic(Topic topic); void updatePost(Post post); }
ForumService { public void addBoard(Board board) { boardDao.save(board); }  @Autowired void setTopicDao(TopicDao topicDao); @Autowired void setUserDao(UserDao userDao); @Autowired void setBoardDao(BoardDao boardDao); @Autowired void setPostDao(PostDao postDao); void addTopic(Topic topic); void removeTopic(int topicId); void addPost(Post post); void removePost(int postId); void addBoard(Board board); void removeBoard(int boardId); void makeDigestTopic(int topicId); List<Board> getAllBoards(); Page getPagedTopics(int boardId,int pageNo,int pageSize); Page getPagedPosts(int topicId,int pageNo,int pageSize); Page queryTopicByTitle(String title,int pageNo,int pageSize); Board getBoardById(int boardId); Topic getTopicByTopicId(int topicId); Post getPostByPostId(int postId); void addBoardManager(int boardId,String userName); void updateTopic(Topic topic); void updatePost(Post post);  }