Package nl.siegmann.epublib.bookprocessor

Examples of nl.siegmann.epublib.bookprocessor.FixIdentifierBookProcessor.processBook()


public class FixIdentifierBookProcessorTest extends TestCase {

  public void test_empty_book() {
    Book book = new Book();
    FixIdentifierBookProcessor fixIdentifierBookProcessor = new FixIdentifierBookProcessor();
    Book resultBook = fixIdentifierBookProcessor.processBook(book);
    assertEquals(1, resultBook.getMetadata().getIdentifiers().size());
    Identifier identifier = CollectionUtil.first(resultBook.getMetadata().getIdentifiers());
    assertEquals(Identifier.Scheme.UUID, identifier.getScheme());
  }
View Full Code Here


  public void test_single_identifier() {
    Book book = new Book();
    Identifier identifier = new Identifier(Identifier.Scheme.ISBN, "1234");
    book.getMetadata().addIdentifier(identifier);
    FixIdentifierBookProcessor fixIdentifierBookProcessor = new FixIdentifierBookProcessor();
    Book resultBook = fixIdentifierBookProcessor.processBook(book);
    assertEquals(1, resultBook.getMetadata().getIdentifiers().size());
    Identifier actualIdentifier = CollectionUtil.first(resultBook.getMetadata().getIdentifiers());
    assertEquals(identifier, actualIdentifier);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.