Search in sources :

Example 1 with BookDescription

use of org.geometerplus.fbreader.description.BookDescription in project FBReaderJ by geometer.

the class TestBookCollection method testExternalBook.

public void testExternalBook() {
    BookDescription bd = BookDescription.getDescription(myDirectory + "/" + filename);
    assertTrue(bd != null);
    BookCollection bc = new BookCollection();
    bc.isBookExternal(bd);
    ArrayList authors = bc.authors();
    for (int i = 0; i < authors.size(); i++) {
        System.out.println(authors.get(i));
    }
}
Also used : BookCollection(org.geometerplus.fbreader.collection.BookCollection) ArrayList(java.util.ArrayList) BookDescription(org.geometerplus.fbreader.description.BookDescription)

Example 2 with BookDescription

use of org.geometerplus.fbreader.description.BookDescription in project FBReaderJ by geometer.

the class TestDescriptionBook method testLanguageEncoding.

public void testLanguageEncoding() {
    BookDescription bd = BookDescription.getDescription(myDirectory + "/" + filename);
    assertTrue(bd != null);
    assertEquals(bd.getEncoding(), "auto");
    assertEquals(bd.getFileName(), "test/data/fb2/filesystem/testfb2book.fb2");
    assertEquals(bd.getLanguage(), "ru");
    //System.out.println(bd.getNumberInSequence());	
    assertEquals(bd.getSequenceName(), "����������� ������ ���������");
    assertEquals(bd.getTitle(), "�������� ���������");
}
Also used : BookDescription(org.geometerplus.fbreader.description.BookDescription)

Example 3 with BookDescription

use of org.geometerplus.fbreader.description.BookDescription in project FBReaderJ by geometer.

the class TestDescriptionBook method testGetDescription.

public void testGetDescription() {
    BookDescription bd = BookDescription.getDescription(myDirectory + "/" + filename, false);
    assertTrue(bd != null);
    BookDescription bd2 = BookDescription.getDescription(myDirectory + "/c" + filename, false);
    assertTrue(bd2 == null);
}
Also used : BookDescription(org.geometerplus.fbreader.description.BookDescription)

Example 4 with BookDescription

use of org.geometerplus.fbreader.description.BookDescription in project FBReaderJ by geometer.

the class TestDescriptionBook method testAuthor.

public void testAuthor() {
    BookDescription bd = BookDescription.getDescription(myDirectory + "/" + filename);
    assertTrue(bd != null);
    Author author = bd.getAuthor();
    assertTrue(author != null);
    assertEquals(author.getDisplayName(), "����� ������");
    assertEquals(author.getSortKey(), "������");
    assertEquals(author.isSingle(), true);
}
Also used : BookDescription(org.geometerplus.fbreader.description.BookDescription) Author(org.geometerplus.fbreader.description.Author)

Example 5 with BookDescription

use of org.geometerplus.fbreader.description.BookDescription in project FBReaderJ by geometer.

the class TestDescriptionBook method testBookModel.

public void testBookModel() {
    BookDescription bd = BookDescription.getDescription(myDirectory + "/" + filename, false);
    assertTrue(bd != null);
    BookModel bm = new BookModel(bd);
    assertTrue(bm != null);
//System.out.println(bm.getContentsModel().getParagraphsNumber());
}
Also used : BookModel(org.geometerplus.fbreader.bookmodel.BookModel) BookDescription(org.geometerplus.fbreader.description.BookDescription)

Aggregations

BookDescription (org.geometerplus.fbreader.description.BookDescription)5 ArrayList (java.util.ArrayList)1 BookModel (org.geometerplus.fbreader.bookmodel.BookModel)1 BookCollection (org.geometerplus.fbreader.collection.BookCollection)1 Author (org.geometerplus.fbreader.description.Author)1