diff options
author | Yegor Kozlov <yegor@apache.org> | 2009-08-23 12:34:24 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2009-08-23 12:34:24 +0000 |
commit | 2712b14d2f43f51e80818936b0de97d36865ee3b (patch) | |
tree | 86c800395ba7ccc7ed084f080f1bd5ed7f2e0bc7 /src/ooxml/testcases/org/apache/poi/TestEmbeded.java | |
parent | e8b5f3670405426c04e3e2fb12400fceb375c8d2 (diff) | |
download | poi-2712b14d2f43f51e80818936b0de97d36865ee3b.tar.gz poi-2712b14d2f43f51e80818936b0de97d36865ee3b.zip |
moved all test data to a top-level directory, refactored all junit usages of .testdata.path to one place
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@806959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/TestEmbeded.java')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/TestEmbeded.java | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/TestEmbeded.java b/src/ooxml/testcases/org/apache/poi/TestEmbeded.java index ddd394cf2d..dd63f2799f 100644 --- a/src/ooxml/testcases/org/apache/poi/TestEmbeded.java +++ b/src/ooxml/testcases/org/apache/poi/TestEmbeded.java @@ -36,34 +36,24 @@ import junit.framework.TestCase; */ public class TestEmbeded extends TestCase { - public String dirname; - - public void setUp() { - dirname = System.getProperty("OOXML.testdata.path"); - assertNotNull(dirname); - } - public void testExcel() throws Exception { - File f = new File(dirname, "ExcelWithAttachments.xlsm"); - assertTrue(f.exists()); - - POIXMLDocument doc = new XSSFWorkbook(OPCPackage.open(f.toString())); + POIXMLDocument doc = new XSSFWorkbook( + POIDataSamples.getSpreadSheetInstance().openResourceAsStream("ExcelWithAttachments.xlsm") + ); test(doc, 4); } public void testWord() throws Exception { - File f = new File(dirname, "WordWithAttachments.docx"); - assertTrue(f.exists()); - - POIXMLDocument doc = new XWPFDocument(OPCPackage.open(f.toString())); + POIXMLDocument doc = new XWPFDocument( + POIDataSamples.getDocumentInstance().openResourceAsStream("WordWithAttachments.docx") + ); test(doc, 5); } public void testPowerPoint() throws Exception { - File f = new File(dirname, "PPTWithAttachments.pptm"); - assertTrue(f.exists()); - - POIXMLDocument doc = new XSLFSlideShow(OPCPackage.open(f.toString())); + POIXMLDocument doc = new XSLFSlideShow(OPCPackage.open( + POIDataSamples.getSlideShowInstance().openResourceAsStream("PPTWithAttachments.pptm")) + ); test(doc, 4); } |