aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/util
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2008-11-14 02:20:22 +0000
committerJosh Micich <josh@apache.org>2008-11-14 02:20:22 +0000
commitdfa42cbf38a6e7adf0e98cc6e76f6126c9fc4617 (patch)
treee635f9b5d0c53c12353afd2604efc43834408321 /src/testcases/org/apache/poi/hssf/util
parentd912570a29935975c47b7e36913db890123e59d2 (diff)
downloadpoi-dfa42cbf38a6e7adf0e98cc6e76f6126c9fc4617.tar.gz
poi-dfa42cbf38a6e7adf0e98cc6e76f6126c9fc4617.zip
Fix for bug 46174 - HSSFName now handles general formulas (not just area references)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@713909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/util')
-rwxr-xr-xsrc/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java1
-rw-r--r--src/testcases/org/apache/poi/hssf/util/TestAreaReference.java4
-rwxr-xr-xsrc/testcases/org/apache/poi/hssf/util/TestRangeAddress.java46
3 files changed, 3 insertions, 48 deletions
diff --git a/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java b/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
index 45c96e6c42..d38b7306f8 100755
--- a/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
+++ b/src/testcases/org/apache/poi/hssf/util/AllHSSFUtilTests.java
@@ -32,7 +32,6 @@ public class AllHSSFUtilTests {
result.addTestSuite(TestAreaReference.class);
result.addTestSuite(TestCellReference.class);
result.addTestSuite(TestHSSFColor.class);
- result.addTestSuite(TestRangeAddress.class);
result.addTestSuite(TestRKUtil.class);
return result;
}
diff --git a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java
index f19aa0ca4d..2de4c9c1ca 100644
--- a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java
+++ b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
import junit.framework.TestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
+import org.apache.poi.hssf.model.HSSFFormulaParser;
import org.apache.poi.hssf.model.Workbook;
import org.apache.poi.hssf.record.NameRecord;
import org.apache.poi.hssf.record.formula.Area3DPtg;
@@ -107,6 +108,7 @@ public final class TestAreaReference extends TestCase {
TestCellReference.confirmCell(allCells[2], "Tabelle1", 6, 1, true, true, "Tabelle1!$B$7");
}
+ // TODO - remove this sub-class
private static final class HSSFWB extends HSSFWorkbook {
public HSSFWB(InputStream in) throws IOException {
super(in);
@@ -220,7 +222,7 @@ public final class TestAreaReference extends TestCase {
assertEquals(refB, ptgC.toFormulaString(eb));
assertEquals(",", ptgD.toFormulaString());
- assertEquals(ref, nr.getAreaReference(wb));
+ assertEquals(ref, HSSFFormulaParser.toFormulaString(wb, nr.getNameDefinition()));
// Check the high level definition
int idx = wb.getNameIndex("test");
diff --git a/src/testcases/org/apache/poi/hssf/util/TestRangeAddress.java b/src/testcases/org/apache/poi/hssf/util/TestRangeAddress.java
deleted file mode 100755
index 6154173e71..0000000000
--- a/src/testcases/org/apache/poi/hssf/util/TestRangeAddress.java
+++ /dev/null
@@ -1,46 +0,0 @@
-
-/* ====================================================================
- 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.util;
-
-import junit.framework.TestCase;
-
-/**
- * Tests the Range Address Utility Functionality
- * @author Danny Mui (danny at muibros.com)
- */
-public class TestRangeAddress extends TestCase {
- public TestRangeAddress(String s) {
- super(s);
- }
-
- public static void main(java.lang.String[] args) {
- junit.textui.TestRunner.run(TestRangeAddress.class);
- }
-
-
-
- public void testReferenceParse() {
- String reference = "Sheet2!$A$1:$C$3";
- RangeAddress ra = new RangeAddress(reference);
-
- assertEquals("Sheet2!A1:C3", ra.getAddress());
-
- }
-}