// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static byte[] createJpegCover(int width, int height) throws IOException {
// 	BufferedImage bufferedImage = new BufferedImage(100, 200, BufferedImage.TYPE_INT_RGB);
// 	Graphics2D g = bufferedImage.createGraphics();
// 	g.drawLine(0, 0, width, height);
// 	g.drawLine(width, 0, 0, height);
// 	g.dispose();
// 		
// 	return getImageBytes(bufferedImage, "image/jpeg");
// }
// 
// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static MobiDocument reReadDocument(MobiDocument doc) throws IOException {
// 	byte[] newMobiData = writeDoc(doc);
// 	MobiDocument newDoc = readDoc(newMobiData);
// 	return newDoc;
// }
// 
// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static void verifyRecordIndices(MobiContentHeader mobiHeader, List<MobiContent> mobiContents) {
// 	assertEquals(MobiContent.CONTENT_TYPE.FCIS, mobiContents.get(mobiHeader.getFcisRecordIndex()).getType());
// 	assertEquals(MobiContent.CONTENT_TYPE.FLIS, mobiContents.get(mobiHeader.getFlisRecordIndex()).getType());
// 
// 	if (mobiHeader.getSrcsRecordIndex() != -1) {
// 		assertEquals(MobiContent.CONTENT_TYPE.SRCS, mobiContents.get(mobiHeader.getSrcsRecordIndex()).getType());
// 	}
// }


import static org.apache.commons.lang3.CharEncoding.UTF_8;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.rr.mobi4java.MobiTestUtils.createJpegCover;
import static org.rr.mobi4java.MobiTestUtils.reReadDocument;
import static org.rr.mobi4java.MobiTestUtils.verifyRecordIndices;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
import org.junit.Test;
package org.rr.mobi4java;




public class TestEmptyTemplate {

	@Test
	public void testCreateNewMobiDocument() throws IOException {
		MobiDocument doc = new MobiReader().empty();
		assertNotNull(doc);
		assertEquals("<html><head><guide></guide></head><body><p></p></body></html>", doc.getTextContent());
		assertEquals(EMPTY, doc.getFullName());
		assertTrue(doc.getImageContents().isEmpty());
		assertEquals(UTF_8, doc.getCharacterEncoding());
		assertTrue(doc.getImages().isEmpty());
		assertNull(doc.getThumbnail());
		verifyRecordIndices(doc.getMobiHeader(), doc.getMobiContents());
		
// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static byte[] createJpegCover(int width, int height) throws IOException {
// 	BufferedImage bufferedImage = new BufferedImage(100, 200, BufferedImage.TYPE_INT_RGB);
// 	Graphics2D g = bufferedImage.createGraphics();
// 	g.drawLine(0, 0, width, height);
// 	g.drawLine(width, 0, 0, height);
// 	g.dispose();
// 		
// 	return getImageBytes(bufferedImage, "image/jpeg");
// }
// 
// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static MobiDocument reReadDocument(MobiDocument doc) throws IOException {
// 	byte[] newMobiData = writeDoc(doc);
// 	MobiDocument newDoc = readDoc(newMobiData);
// 	return newDoc;
// }
// 
// Path: src/test/java/org/rr/mobi4java/MobiTestUtils.java
// static void verifyRecordIndices(MobiContentHeader mobiHeader, List<MobiContent> mobiContents) {
// 	assertEquals(MobiContent.CONTENT_TYPE.FCIS, mobiContents.get(mobiHeader.getFcisRecordIndex()).getType());
// 	assertEquals(MobiContent.CONTENT_TYPE.FLIS, mobiContents.get(mobiHeader.getFlisRecordIndex()).getType());
// 
// 	if (mobiHeader.getSrcsRecordIndex() != -1) {
// 		assertEquals(MobiContent.CONTENT_TYPE.SRCS, mobiContents.get(mobiHeader.getSrcsRecordIndex()).getType());
// 	}
// }


// Path: src/test/java/org/rr/mobi4java/TestEmptyTemplate.java
import static org.apache.commons.lang3.CharEncoding.UTF_8;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.rr.mobi4java.MobiTestUtils.createJpegCover;
import static org.rr.mobi4java.MobiTestUtils.reReadDocument;
import static org.rr.mobi4java.MobiTestUtils.verifyRecordIndices;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
import org.junit.Test;

package org.rr.mobi4java;




public class TestEmptyTemplate {

	@Test
	public void testCreateNewMobiDocument() throws IOException {
		MobiDocument doc = new MobiReader().empty();
		assertNotNull(doc);
		assertEquals("<html><head><guide></guide></head><body><p></p></body></html>", doc.getTextContent());
		assertEquals(EMPTY, doc.getFullName());
		assertTrue(doc.getImageContents().isEmpty());
		assertEquals(UTF_8, doc.getCharacterEncoding());
		assertTrue(doc.getImages().isEmpty());
		assertNull(doc.getThumbnail());
		verifyRecordIndices(doc.getMobiHeader(), doc.getMobiContents());
		
		MobiDocument newDoc = reReadDocument(doc);