aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-08-05 16:03:51 +0000
committerNick Burch <nick@apache.org>2008-08-05 16:03:51 +0000
commited740f6d98cc733a3b32e6f336c3882dfa5c0d3e (patch)
treec7802bc973f0d66acb8a187e32b9888176052a9a
parentb2c3f99735ff90e2f95c8cab3d0f7c9c553c1fad (diff)
downloadpoi-ed740f6d98cc733a3b32e6f336c3882dfa5c0d3e.tar.gz
poi-ed740f6d98cc733a3b32e6f336c3882dfa5c0d3e.zip
Test to show that bug #45544 is incorrect
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@682769 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java25
-rw-r--r--src/testcases/org/apache/poi/hssf/data/45544.xlsxbin0 -> 43042 bytes
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
index 70773ad54c..b00d5228a4 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExcelExtractor.java
@@ -212,4 +212,29 @@ public class TestXSSFExcelExtractor extends TestCase {
assertTrue("Unable to find expected word in text\n" + text, text.contains("test phrase"));
}
}
+
+ /**
+ * From bug #45544
+ */
+ public void testComments() throws Exception {
+ File xml = new File(
+ System.getProperty("HSSF.testdata.path") +
+ File.separator + "45544.xlsx"
+ );
+ assertTrue(xml.exists());
+
+ XSSFExcelExtractor extractor =
+ new XSSFExcelExtractor(new XSSFWorkbook(xml.toString()));
+ String text = extractor.getText();
+
+ // No comments there yet
+ assertFalse("Unable to find expected word in text\n" + text, text.contains("testdoc"));
+ assertFalse("Unable to find expected word in text\n" + text, text.contains("test phrase"));
+
+ // Turn on comment extraction, will then be
+ extractor.setIncludeCellComments(true);
+ text = extractor.getText();
+ assertTrue("Unable to find expected word in text\n" + text, text.contains("testdoc"));
+ assertTrue("Unable to find expected word in text\n" + text, text.contains("test phrase"));
+ }
}
diff --git a/src/testcases/org/apache/poi/hssf/data/45544.xlsx b/src/testcases/org/apache/poi/hssf/data/45544.xlsx
new file mode 100644
index 0000000000..2390e6d9ab
--- /dev/null
+++ b/src/testcases/org/apache/poi/hssf/data/45544.xlsx
Binary files differ