From 06efaaecf8b5d89a7b2e7823098c6110a7b3f989 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 13 Mar 2015 16:46:15 +0000 Subject: [PATCH] Stub unit tests for #57699 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1666510 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/extractor/TestExtractorFactory.java | 16 ++++++++++++++++ .../apache/poi/xssf/usermodel/TestXSSFBugs.java | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java index b2edea6a3a..003c0eccf5 100644 --- a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java +++ b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java @@ -51,6 +51,7 @@ public class TestExtractorFactory extends TestCase { private File xls; private File xlsx; + private File xlsxStrict; private File xltx; private File xlsEmb; @@ -90,6 +91,7 @@ public class TestExtractorFactory extends TestCase { 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"); @@ -159,6 +161,20 @@ public class TestExtractorFactory extends TestCase { ); extractor.close(); + // TODO Support OOXML-Strict, see bug #57699 +// extractor = ExtractorFactory.createExtractor(xlsxStrict); +// assertTrue( +// extractor +// instanceof XSSFExcelExtractor +// ); +// extractor.close(); +// +// extractor = ExtractorFactory.createExtractor(xlsxStrict); +// assertTrue( +// extractor.getText().contains("test") +// ); +// extractor.close(); + // Word assertTrue( diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index ad9c3ad6f8..6334326c5e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -2290,4 +2290,16 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { wb.close(); } } + + /** + * OOXML-Strict files + */ + @Test + @Ignore + public void test57699() throws Exception { + Workbook wb = XSSFTestDataSamples.openSampleWorkbook("sample.strict.xlsx"); + assertEquals(3, wb.getNumberOfSheets()); + + // TODO Check the rest + } } -- 2.39.5