aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/extractor
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-09-21 19:17:41 +0000
committerNick Burch <nick@apache.org>2008-09-21 19:17:41 +0000
commitdefb284d5a46b65be1f50de093ef8607fb6bc3ac (patch)
tree481549f3d6da53b3f9b24c586fb1233426fadc77 /src/testcases/org/apache/poi/hssf/extractor
parent47600ff855e7855ecc8dd812b8f9a6ea08c20278 (diff)
downloadpoi-defb284d5a46b65be1f50de093ef8607fb6bc3ac.tar.gz
poi-defb284d5a46b65be1f50de093ef8607fb6bc3ac.zip
Update hssf.extractor.ExcelExtractor to optionally output blank cells too
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@697589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/extractor')
-rw-r--r--src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java21
1 files changed, 21 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 cb028edfa5..d715650528 100644
--- a/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
+++ b/src/testcases/org/apache/poi/hssf/extractor/TestExcelExtractor.java
@@ -187,6 +187,27 @@ public final class TestExcelExtractor extends TestCase {
);
}
+ public void testWithBlank() throws Exception {
+ ExcelExtractor extractor = createExtractor("MissingBits.xls");
+ String def = extractor.getText();
+ extractor.setIncludeBlankCells(true);
+ String padded = extractor.getText();
+
+ assertTrue(def.startsWith(
+ "Sheet1\n" +
+ "&[TAB]\t\n" +
+ "Hello\t\n" +
+ "11.0\t23.0\t\n"
+ ));
+
+ assertTrue(padded.startsWith(
+ "Sheet1\n" +
+ "&[TAB]\t\n" +
+ "Hello\t\t\t\t\t\t\t\t\t\t\t\n" +
+ "11.0\t\t\t23.0\t\t\t\t\t\t\t\t\n"
+ ));
+ }
+
/**
* Embded in a non-excel file