@Test public void testGetBookMetaData() { for (int i = 0; i < bibles.length; i++) { Book bible = bibles[i]; BookMetaData bmd = bible.getBookMetaData(); Assert.assertEquals(bmds[i], bmd); } }
@Before public void setUp() throws Exception { List<Book> lbmds = Books.installed().getBooks(BookFilters.getOnlyBibles()); int numBibles = lbmds.size(); bibles = new Book[numBibles]; bmds = new BookMetaData[numBibles]; gen11 = new Key[numBibles]; int i = 0; for (Book book : lbmds) { bibles[i] = book; bmds[i] = book.getBookMetaData(); gen11[i] = book.getKey("Gen 1:1"); i++; } }
/** Read all the books that we can get our hands on. */ public static void main(String[] args) throws IOException { out = new PrintWriter(new BufferedWriter(new FileWriter("passages.log"))); // Loop through all the Books log.warn("*** Reading all known Books"); BookFilter filter = BookFilters.getCustom("GlobalOptionFilter=ThMLScripref;Category=Biblical Texts"); List<Book> comments = Books.installed().getBooks(filter); for (Book book : comments) { if (!book.isLocked()) { BookMetaData bmd = book.getBookMetaData(); // Skip PlainText as they do not have references marked up if (bmd.getProperty("SourceType") != null) { Key set = book.getGlobalKeyList(); readBook(book, set); } } } out.flush(); out.close(); }