From 786b7ce4ddeb905236cee48eac17339db2a36682 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Thu, 22 Sep 2016 03:29:00 +0000 Subject: [PATCH] bug 45565: add failing unit test for bug 45565 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761841 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/extractor/TestExtractorFactory.java | 13 +++++++++++++ test-data/spreadsheet/45565.xls | Bin 0 -> 13824 bytes 2 files changed, 13 insertions(+) create mode 100644 test-data/spreadsheet/45565.xls diff --git a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java index 9d206f7197..92a963f07a 100644 --- a/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java +++ b/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java @@ -16,6 +16,7 @@ ==================================================================== */ package org.apache.poi.extractor; +import static org.apache.poi.POITestCase.assertContains; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -37,6 +38,7 @@ import org.apache.poi.hdgf.extractor.VisioTextExtractor; import org.apache.poi.hpbf.extractor.PublisherTextExtractor; import org.apache.poi.hslf.extractor.PowerPointExtractor; import org.apache.poi.hsmf.extractor.OutlookTextExtactor; +import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.hssf.OldExcelFormatException; import org.apache.poi.hssf.extractor.EventBasedExcelExtractor; import org.apache.poi.hssf.extractor.ExcelExtractor; @@ -1019,4 +1021,15 @@ public class TestExtractorFactory { // expected here } } + + // This bug is currently open. This test will fail with "expected error not thrown" when the bug has been fixed. + // When this happens, change this from @Test(expected=...) to @Test + @Test(expected=AssertionError.class) + public void test45565() throws Exception { + POITextExtractor extractor = ExtractorFactory.createExtractor(HSSFTestDataSamples.getSampleFile("45565.xls")); + String text = extractor.getText(); + assertContains(text, "testdoc"); + assertContains(text, "test phrase"); + extractor.close(); + } } diff --git a/test-data/spreadsheet/45565.xls b/test-data/spreadsheet/45565.xls new file mode 100644 index 0000000000000000000000000000000000000000..7facba52bff94d0c37da2019b3aa0202f6e35e28 GIT binary patch literal 13824 zcmeHOU2IfE6#njZce}eSZFkF$R@tmY1GJR@jY`5#R}mu*L;^7okhG-~+Z0*Yt`Q~1 zMQvgtDuxGnFj0KcXcVJ?7o+VPJ`jls5BgvV;msNsBS8{m{l2-q-Q9M#DMmrb%*{D7 zd*t1dHSj(|3Bm8^HX0UO&C~4yGxx;eUic zIK++&2GE!|Q~m8QlU2ZZ_;A8MLJnLYJ%xQ52T!N_Ur6mt+??=;v7y_M4Z|FGtDPVm z%Bt`#c^${0a$<%z8vdCn`<3CVnKSBa!}gWGEM38JVBM|0q$&4?;mwBEkvlkL>ilRV z%g}_=ET4brh=x0`Kj1u!H2TqvJ^1%>zaAl4T4eg+^~IAAkNXF(810pmcCr)PD(Z%*Dhv54rTl`z z(mYSyA$H}Oa_T0-QAut2a;54!&@rvg2hmCt%K%+yykPxQ&&!o6Z$P0H<+~V+Vz#-x zF6R>_cG+-3a@}}F{=1hoygs4N5z&sGD$e$?kjL$)ffIGPQbIF|LBxG`I8Vq{_B+1Wt8%TX^5@rnOpwX6(cb6;<7W|<_J zNRec@BnNAXB<+Xc=UBQ2BTk3}G=J^jXKX_~klUn!22}oQ zVvN7x<1K_koCgpZc9P^t#4mB)#4M(3N%KfofQD-<=Y>4m45249hvdnCIpay6Y~jWu~cG@?A7uQ&yCm`l#UAN0+|euybQar;)c9d8^?s8%egvr27au zr#2j7&WK+(pv-y2lz!Fl<9u|fgkvuMgt@?I2QwH(I~+X8vNX$A=ZYry7*5K*T$~8f zww(MHkWyQZs$7urdiZmTD02|bm3rzn<3q&MW8ZN?bj$B%{6VcNcjN-W>tW~I%Vd_n zj)#ZX9`L&HLERN8=`LDhI#ODbY~TW|I^k4vQU{_rGER_9^fkueMQpp&;<1J?nQy|F z!Elx-dD4j?Ch$#&(NBd{Xao`yA=5jU*_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