diff options
author | Josh Micich <josh@apache.org> | 2008-05-06 03:57:15 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-05-06 03:57:15 +0000 |
commit | 34ce6171ac80f0df599fcfb58db3879dad6b0cf7 (patch) | |
tree | 8a4f1747d85077681d4b466fadec71816199e542 /src/testcases/org/apache | |
parent | 1a09f3e1dd61f71339e71fdfe548d88d48c82734 (diff) | |
download | poi-34ce6171ac80f0df599fcfb58db3879dad6b0cf7.tar.gz poi-34ce6171ac80f0df599fcfb58db3879dad6b0cf7.zip |
42570 - fixed LabelRecord to use empty string instead of null when the length is zero.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@653675 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/data/ex42570-20305.xls | bin | 0 -> 192512 bytes | |||
-rwxr-xr-x | src/testcases/org/apache/poi/hssf/record/AllRecordTests.java | 1 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java | 41 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/data/ex42570-20305.xls b/src/testcases/org/apache/poi/hssf/data/ex42570-20305.xls Binary files differnew file mode 100644 index 0000000000..e3d4cc8372 --- /dev/null +++ b/src/testcases/org/apache/poi/hssf/data/ex42570-20305.xls diff --git a/src/testcases/org/apache/poi/hssf/record/AllRecordTests.java b/src/testcases/org/apache/poi/hssf/record/AllRecordTests.java index d2a1b36841..2b8e3c3ab5 100755 --- a/src/testcases/org/apache/poi/hssf/record/AllRecordTests.java +++ b/src/testcases/org/apache/poi/hssf/record/AllRecordTests.java @@ -67,6 +67,7 @@ public final class AllRecordTests { result.addTestSuite(TestFormulaRecord.class); result.addTestSuite(TestFrameRecord.class); result.addTestSuite(TestHyperlinkRecord.class); + result.addTestSuite(TestLabelRecord.class); result.addTestSuite(TestLegendRecord.class); result.addTestSuite(TestLineFormatRecord.class); result.addTestSuite(TestLinkedDataRecord.class); diff --git a/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java b/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java new file mode 100644 index 0000000000..10f363652e --- /dev/null +++ b/src/testcases/org/apache/poi/hssf/record/TestLabelRecord.java @@ -0,0 +1,41 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.hssf.record; + +import org.apache.poi.hssf.HSSFTestDataSamples; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; +/** + * Tests for <tt>LabelRecord</tt> + * + * @author Josh Micich + */ +public final class TestLabelRecord extends TestCase { + + public void testEmptyString() { + HSSFWorkbook wb; + try { + wb = HSSFTestDataSamples.openSampleWorkbook("ex42570-20305.xls"); + } catch (NullPointerException e) { + throw new AssertionFailedError("Identified bug 42570"); + } + HSSFTestDataSamples.writeOutAndReadBack(wb); + } +} |