aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorAvik Sengupta <avik@apache.org>2005-05-07 17:25:26 +0000
committerAvik Sengupta <avik@apache.org>2005-05-07 17:25:26 +0000
commit588c498c5b920108cc0babe636889c7a05c14692 (patch)
treed9a68bef5bb64ff78789d6dfd8c973864a11d27e /src/testcases
parentc3b74a65d6474351c571f74bdfa3a9f15312de4c (diff)
downloadpoi-588c498c5b920108cc0babe636889c7a05c14692.tar.gz
poi-588c498c5b920108cc0babe636889c7a05c14692.zip
user API to set window pane when wb is opened
by Amol Deshmukh and Li Jianming git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
index 9afd152786..24c67dc979 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
@@ -409,7 +409,34 @@ public class TestHSSFSheet
assertEquals ("DBCS Sheet Name 2", wb.getSheetName(1),"\u090f\u0915" );
assertEquals("DBCS Sheet Name 1", wb.getSheetName(0),"\u091c\u093e");
}
-
+
+ /**
+ * Testing newly added method that exposes the WINDOW2.toprow
+ * parameter to allow setting the toprow in the visible view
+ * of the sheet when it is first opened.
+ */
+ public void testTopRow() throws Exception
+ {
+ FileInputStream fis = null;
+ HSSFWorkbook wb = null;
+
+ String filename = System.getProperty("HSSF.testdata.path");
+
+ filename = filename + "/SimpleWithPageBreaks.xls";
+ fis = new FileInputStream(filename);
+ wb = new HSSFWorkbook(fis);
+ fis.close();
+
+ HSSFSheet sheet = wb.getSheetAt(0);
+ assertNotNull(sheet);
+
+ short toprow = (short) 100;
+ short leftcol = (short) 50;
+ sheet.showInPane(toprow,leftcol);
+ assertEquals("HSSFSheet.getTopRow()", toprow, sheet.getTopRow());
+ assertEquals("HSSFSheet.getLeftCol()", leftcol, sheet.getLeftCol());
+ }
+
public static void main(java.lang.String[] args) {
junit.textui.TestRunner.run(TestHSSFSheet.class);
}