diff options
author | Nick Burch <nick@apache.org> | 2008-05-23 15:22:18 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2008-05-23 15:22:18 +0000 |
commit | 83ad24728abf377e2700fb2b80c4bfd3135a668e (patch) | |
tree | 86d19d8d800c5d00bc54c506422d33dfb5e79381 /src/testcases | |
parent | a97602aa11fa5669ef98ee34f92b23f4f1ffe4fd (diff) | |
download | poi-83ad24728abf377e2700fb2b80c4bfd3135a668e.tar.gz poi-83ad24728abf377e2700fb2b80c4bfd3135a668e.zip |
Patch from Yury, plus tests, from bug #45043 - Support for getting excel cell comments when extracting text
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@659572 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java b/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java index 63d67ee771..9bb137ff69 100644 --- a/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java +++ b/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java @@ -165,6 +165,28 @@ public final class TestExcelExtractor extends TestCase { ); } + public void testWithComments() throws Exception { + ExcelExtractor extractor = createExtractor("SimpleWithComments.xls"); + extractor.setIncludeSheetNames(false); + + // Check without comments + assertEquals( + "1.0\tone\n" + + "2.0\ttwo\n" + + "3.0\tthree\n", + extractor.getText() + ); + + // Now with + extractor.setIncludeCellComments(true); + assertEquals( + "1.0\tone Comment by Yegor Kozlov: Yegor Kozlov: first cell\n" + + "2.0\ttwo Comment by Yegor Kozlov: Yegor Kozlov: second cell\n" + + "3.0\tthree Comment by Yegor Kozlov: Yegor Kozlov: third cell\n", + extractor.getText() + ); + } + /** * Embded in a non-excel file |