package main.managepdf;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import main.manageclip.ManageKindleClip;
import model.Anotation;

public class ManagePdfTest {

	private ManageAnotationToPDF manageAnotationToPDF;
	private ManageKindleClip manageKindleClip;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		manageAnotationToPDF = new ManageAnotationToPDF();
		manageKindleClip = new ManageKindleClip();
	}

	@Test
	public final void testCreatePDFWithInfo() throws IOException, URISyntaxException {
		File clipFile = new File(getClass().getResource("/test/managepdf/clip_3_anotations_to_match_pdf.txt").toURI());
		String pdfNameFile = "pdf_ingles_sem_anotation";
		String pdfNameFileExt = pdfNameFile.concat(".pdf");
		File pdfFile = new File(getClass().getResource("/test/managepdf/"+pdfNameFileExt).toURI());
		
		List<Anotation> anotations = manageKindleClip.extractInfoFromClipFile(pdfNameFile, clipFile);
		File createPDFWithInfo = manageAnotationToPDF.createPDFWithInfo(anotations, pdfFile);
		assertNotNull(createPDFWithInfo);		
	}
	
	/**
	 * Testar a busca por anotaes no PDF
	 */
	@Test
	public final void testAnotationSearching(){
		
	}

}

@@ -67,51 +67,8 @@
 ull;
-%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aim
@@ -1307,16 +1307,619 @@
 %09%09%0A%09%7D%0A%09%0A
+%09@Test%0A%09public final void testRealClipAndPDF() throws IOException, URISyntaxException %7B%0A%09%09File clipFile = new File(getClass().getResource(%22/test/managepdf/My Clippings.txt%22).toURI());%0A%09%09String pdfNameFile = %22Piga_comentado%22;%0A%09%09String pdfNameFileExt = pdfNameFile.concat(%22.pdf%22);%0A%09%09File pdfFile = new File(getClass().getResource(%22/test/managepdf/%22+pdfNameFileExt).toURI());%0A%09%09%0A%09%09List%3CAnotation%3E anotations = manageKindleClip.extractInfoFromClipFile(pdfNameFile, clipFile);%0A%09%09File createPDFWithInfo = manageAnotationToPDF.createPDFWithInfo(anotations, pdfFile);%0A%09%09assertNotNull(createPDFWithInfo);%09%09%0A%09%7D%0A%09%0A
 %09/**%0A%09 *

add de novo test. Teste com dados Reais.