mirror of https://github.com/apache/poi.git
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
This commit is contained in:
parent
b2c3f99735
commit
ed740f6d98
|
@ -212,4 +212,29 @@ public class TestXSSFExcelExtractor extends TestCase {
|
||||||
assertTrue("Unable to find expected word in text\n" + text, text.contains("test phrase"));
|
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"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue