コード例 #1
0
 @Test
 public void testAddBookmark() {
   try {
     BookmarkDto newDto = addTestVerse();
     assertEquals(
         "New Bookmark key incorrect.  Test:"
             + currentTestVerse
             + " was:"
             + newDto.getVerse().getName(),
         newDto.getVerse().getName(),
         currentTestVerse);
     assertTrue("New Bookmark id incorrect", newDto.getId() > -1);
   } catch (Exception e) {
     e.printStackTrace();
     fail("exeption:" + e.getMessage());
   }
 }
コード例 #2
0
  @Test
  public void testGetAllBookmarks() {
    try {
      addTestVerse();
      addTestVerse();
      addTestVerse();

      List<BookmarkDto> bookmarks = bookmarkControl.getAllBookmarks();
      for (BookmarkDto dto : bookmarks) {
        System.out.println(dto.getId() + " " + dto.getVerse().getName());
      }
      assertTrue(bookmarks.size() == 3);
    } catch (Exception e) {
      e.printStackTrace();
      fail("exeption:" + e.getMessage());
    }
  }