use of org.olat.test.VFSJavaIOFile in project OpenOLAT by OpenOLAT.
the class OfficeDocumentTest method testExcelOpenXMLDocument.
@Test
public void testExcelOpenXMLDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_excel_indexing.xlsx");
Assert.assertNotNull(docUrl);
VFSLeaf doc = new VFSJavaIOFile(new File(docUrl.toURI()));
ExcelOOXMLDocument document = new ExcelOOXMLDocument();
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
String body = content.getContent();
Assert.assertTrue(body.contains("Numbers and their Squares"));
Assert.assertTrue(body.contains("225"));
}
use of org.olat.test.VFSJavaIOFile in project OpenOLAT by OpenOLAT.
the class OfficeDocumentTest method testWordDocument.
@Test
public void testWordDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_word_indexing.doc");
Assert.assertNotNull(docUrl);
VFSLeaf doc = new VFSJavaIOFile(new File(docUrl.toURI()));
WordDocument document = new WordDocument();
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
String body = content.getContent();
// content
Assert.assertTrue(body.contains("Lorem ipsum dolor sit amet"));
// footer
Assert.assertTrue(body.contains("Rue (domicile)"));
}
use of org.olat.test.VFSJavaIOFile in project OpenOLAT by OpenOLAT.
the class OfficeDocumentTest method testExcelDocument.
@Test
public void testExcelDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_excel_indexing.xls");
Assert.assertNotNull(docUrl);
VFSLeaf doc = new VFSJavaIOFile(new File(docUrl.toURI()));
ExcelDocument document = new ExcelDocument();
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
String body = content.getContent();
Assert.assertTrue(body.contains("Nachname"));
Assert.assertTrue(body.contains("olat4you"));
}
use of org.olat.test.VFSJavaIOFile in project openolat by klemens.
the class OfficeDocumentTest method testWordOpenXMLDocument.
@Test
public void testWordOpenXMLDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_word_indexing.docx");
Assert.assertNotNull(docUrl);
VFSLeaf doc = new VFSJavaIOFile(new File(docUrl.toURI()));
WordOOXMLDocument document = new WordOOXMLDocument();
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
String body = content.getContent();
Assert.assertTrue(body.contains("Document compatibility test"));
Assert.assertTrue(body.contains("They prefer to start writing a document at home in desktop or laptop computer"));
}
use of org.olat.test.VFSJavaIOFile in project openolat by klemens.
the class OfficeDocumentTest method testExcelDocument.
@Test
public void testExcelDocument() throws IOException, DocumentException, DocumentAccessException, URISyntaxException {
URL docUrl = OfficeDocumentTest.class.getResource("Test_excel_indexing.xls");
Assert.assertNotNull(docUrl);
VFSLeaf doc = new VFSJavaIOFile(new File(docUrl.toURI()));
ExcelDocument document = new ExcelDocument();
FileContent content = document.readContent(doc);
Assert.assertNotNull(content);
String body = content.getContent();
Assert.assertTrue(body.contains("Nachname"));
Assert.assertTrue(body.contains("olat4you"));
}
Aggregations