aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/util
diff options
context:
space:
mode:
authorAndrew C. Oliver <acoliver@apache.org>2002-04-30 00:14:54 +0000
committerAndrew C. Oliver <acoliver@apache.org>2002-04-30 00:14:54 +0000
commitdce05e71f05ea7064088f56574fd7e7c9b089a10 (patch)
tree3bb957dc7d60fd0ee2960503ab0ff579cccbf114 /src/testcases/org/apache/poi/hssf/util
parent2184c36b2171cbf65b459c34e43f04932ba059a7 (diff)
downloadpoi-dce05e71f05ea7064088f56574fd7e7c9b089a10.tar.gz
poi-dce05e71f05ea7064088f56574fd7e7c9b089a10.zip
must have missed a commit yesterday...oops
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352559 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/util')
-rw-r--r--src/testcases/org/apache/poi/hssf/util/TestReferenceUtil.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/util/TestReferenceUtil.java b/src/testcases/org/apache/poi/hssf/util/TestReferenceUtil.java
index edd74afc21..4e14b95d17 100644
--- a/src/testcases/org/apache/poi/hssf/util/TestReferenceUtil.java
+++ b/src/testcases/org/apache/poi/hssf/util/TestReferenceUtil.java
@@ -147,6 +147,72 @@ public class TestReferenceUtil
}
+ /**
+ * checks that area reference conversion works
+ */
+ public void testGetXYXYFromAreaRef(){
+ String ref = null;
+
+ ref = "A1:B1";
+
+ assertEquals("fromRef A1 row = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[0],
+ 0);
+
+ assertEquals("fromRef A1 col = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[1],
+ 0);
+
+ assertEquals("fromRef A1 col = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[2],
+ 0);
+
+
+ assertEquals("fromRef A1 col = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[3],
+ 1);
+
+
+ ref = "A1:Z11";
+
+ assertEquals("fromRef A1 row = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[0],
+ 0);
+
+ assertEquals("fromRef A1 col = 0",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[1],
+ 0);
+
+
+ assertEquals("fromRef Z11 row = 10",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[2],
+ 10);
+
+ assertEquals("fromRef Z11 col = 25",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[3],
+ 25);
+
+ ref = "Z11:IV256";
+
+ assertEquals("fromRef Z11 row = 10",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[0],
+ 10);
+
+ assertEquals("fromRef Z11 col = 25",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[1],
+ 25);
+
+
+ assertEquals("fromRef IV256 row = 255",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[2],
+ 255);
+
+ assertEquals("fromRef IV256 col = 255",
+ ReferenceUtil.getXYXYFromAreaRef(ref)[3],
+ 255);
+
+ }
+
public static void main(String [] args) {
System.out
.println("Testing org.apache.poi.hssf.util.ReferenceUtil");