use of org.apache.poi.POIDataSamples in project poi by apache.
the class TestExtractorFactory method setUp.
@BeforeClass
public static void setUp() throws Exception {
POIDataSamples ssTests = POIDataSamples.getSpreadSheetInstance();
xls = getFileAndCheck(ssTests, "SampleSS.xls");
xlsx = getFileAndCheck(ssTests, "SampleSS.xlsx");
xlsxStrict = getFileAndCheck(ssTests, "SampleSS.strict.xlsx");
xltx = getFileAndCheck(ssTests, "test.xltx");
xlsEmb = getFileAndCheck(ssTests, "excel_with_embeded.xls");
xlsb = getFileAndCheck(ssTests, "testVarious.xlsb");
POIDataSamples wpTests = POIDataSamples.getDocumentInstance();
doc = getFileAndCheck(wpTests, "SampleDoc.doc");
doc6 = getFileAndCheck(wpTests, "Word6.doc");
doc95 = getFileAndCheck(wpTests, "Word95.doc");
docx = getFileAndCheck(wpTests, "SampleDoc.docx");
dotx = getFileAndCheck(wpTests, "test.dotx");
docEmb = getFileAndCheck(wpTests, "word_with_embeded.doc");
docEmbOOXML = getFileAndCheck(wpTests, "word_with_embeded_ooxml.doc");
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
ppt = getFileAndCheck(slTests, "SampleShow.ppt");
pptx = getFileAndCheck(slTests, "SampleShow.pptx");
txt = getFileAndCheck(slTests, "SampleShow.txt");
POIDataSamples dgTests = POIDataSamples.getDiagramInstance();
vsd = getFileAndCheck(dgTests, "Test_Visio-Some_Random_Text.vsd");
vsdx = getFileAndCheck(dgTests, "test.vsdx");
POIDataSamples pubTests = POIDataSamples.getPublisherInstance();
pub = getFileAndCheck(pubTests, "Simple.pub");
POIDataSamples olTests = POIDataSamples.getHSMFInstance();
msg = getFileAndCheck(olTests, "quick.msg");
msgEmb = getFileAndCheck(olTests, "attachment_test_msg.msg");
msgEmbMsg = getFileAndCheck(olTests, "attachment_msg_pdf.msg");
}
use of org.apache.poi.POIDataSamples in project poi by apache.
the class TestBugs method test52400ReadAttachedTNEF.
@Test
public void test52400ReadAttachedTNEF() throws Exception {
POIDataSamples samples = POIDataSamples.getHMEFInstance();
String testFile = "bug52400-winmail-with-attachments.dat";
HMEFMessage tnefDat = new HMEFMessage(samples.openResourceAsStream(testFile));
MAPIAttribute bodyHtml = tnefDat.getMessageMAPIAttribute(MAPIProperty.BODY_HTML);
String bodyStr = new String(bodyHtml.getData(), getEncoding(tnefDat));
assertTrue(bodyStr.contains("There are also two attachments."));
assertEquals(2, tnefDat.getAttachments().size());
}
use of org.apache.poi.POIDataSamples in project poi by apache.
the class TestBugs method test52400ReadSimpleTNEF.
@Test
public void test52400ReadSimpleTNEF() throws Exception {
POIDataSamples samples = POIDataSamples.getHMEFInstance();
String testFile = "bug52400-winmail-simple.dat";
HMEFMessage tnefDat = new HMEFMessage(samples.openResourceAsStream(testFile));
MAPIAttribute bodyHtml = tnefDat.getMessageMAPIAttribute(MAPIProperty.BODY_HTML);
String bodyStr = new String(bodyHtml.getData(), getEncoding(tnefDat));
assertTrue(bodyStr.contains("This is the message body."));
}
use of org.apache.poi.POIDataSamples in project poi by apache.
the class TestSlideChangeNotes method init.
@Before
public void init() throws Exception {
POIDataSamples _slTests = POIDataSamples.getSlideShowInstance();
HSLFSlideShowImpl hss = new HSLFSlideShowImpl(_slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
ss = new HSLFSlideShow(hss);
}
use of org.apache.poi.POIDataSamples in project poi by apache.
the class TestReWriteSanity method setUp.
@Before
public void setUp() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
pfs = new POIFSFileSystem(slTests.openResourceAsStream("basic_test_ppt_file.ppt"));
ss = new HSLFSlideShowImpl(pfs);
}
Aggregations