use of org.olat.test.VFSJavaIOFile in project openolat by klemens.
the class PDFDocumentTest method testPDFDocument.
@Test
public void testPDFDocument() throws DocumentException, DocumentAccessException, URISyntaxException, IOException {
URL pdfUrl = PDFDocumentTest.class.getResource("Test_pdf_indexing.pdf");
Assert.assertNotNull(pdfUrl);
VFSLeaf doc = new VFSJavaIOFile("Test_1.pdf", new File(pdfUrl.toURI()));
String temp = System.getProperty("java.io.tmpdir");
PdfDocument document = new PdfDocument(temp, false);
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
Assert.assertEquals("Test pdf indexing", content.getTitle());
String body = content.getContent();
Assert.assertEquals("Un petit texte en français", body.trim());
}
Aggregations