/** @return */
  private BookmarkDto addTestVerse() {
    try {
      currentTestVerse = getNextTestVerse();

      BookmarkDto bookmark = new BookmarkDto();
      bookmark.setVerse(
          VerseFactory.fromString(
              Versifications.instance().getVersification("KJV"), currentTestVerse));
      BookmarkDto newDto = bookmarkControl.addBookmark(bookmark);
      return newDto;
    } catch (Exception e) {
      fail("Error in verse:" + currentTestVerse);
    }
    return null;
  }
Beispiel #2
0
 /*
  * (non-Javadoc)
  *
  * @see org.apache.lucene.search.Collector#collect(int)
  */
 @Override
 public void collect(int docId) throws IOException {
   Document doc = searcher.doc(docBase + docId);
   try {
     Key key = VerseFactory.fromString(v11n, doc.get(LuceneIndex.FIELD_KEY));
     results.addAll(key);
   } catch (NoSuchVerseException e) {
     // Wrap the NoSuchVerseException in an IOException so it can be
     // gotten.
     IOException ioe = new IOException();
     ioe.initCause(e);
     throw ioe;
     // JDK6: Change to:
     // throw new IOException(e);
   }
 }