aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-05-23 15:22:18 +0000
committerNick Burch <nick@apache.org>2008-05-23 15:22:18 +0000
commit83ad24728abf377e2700fb2b80c4bfd3135a668e (patch)
tree86d19d8d800c5d00bc54c506422d33dfb5e79381 /src/testcases
parenta97602aa11fa5669ef98ee34f92b23f4f1ffe4fd (diff)
downloadpoi-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.java22
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