aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2009-02-06 18:59:24 +0000
committerYegor Kozlov <yegor@apache.org>2009-02-06 18:59:24 +0000
commit5831ea5750a9bd6c13574a5971bab245bfc6139c (patch)
tree5f304b90d98b8ba1970d3be9c4b4ae67526c8790 /src/testcases
parent9866e626c7258a77a10df787790cc39d15ec2b44 (diff)
downloadpoi-5831ea5750a9bd6c13574a5971bab245bfc6139c.tar.gz
poi-5831ea5750a9bd6c13574a5971bab245bfc6139c.zip
Improved error handling for problems described in bugzilla 46569 - Changed Sheet.setColumnWidth to throw IllegalArgumentException if the column width argument is greater than 255 characters (the maximum column width in Excel)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@741678 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java b/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java
index 477908dc72..9afae28b13 100644
--- a/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java
+++ b/src/testcases/org/apache/poi/hssf/model/TestSheetAdditional.java
@@ -54,4 +54,15 @@ public final class TestSheetAdditional extends TestCase {
assertEquals((short)100,sheet.getColumnWidth((short)9));
assertEquals((short)100,sheet.getColumnWidth((short)10));
}
+
+ public void testMaxColumnWidth() {
+ Sheet sheet = Sheet.createSheet();
+ sheet.setColumnWidth(0, 255*256); //the limit
+ try {
+ sheet.setColumnWidth(0, 256*256); //the limit
+ fail("expected exception");
+ } catch (Exception e){
+ ;
+ }
+ }
}