Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / sheet / _XViewPane.java
blobff438f1fc5c79e0d7f2314cd9d39c029a2c40d3f
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc.sheet;
21 import lib.MultiMethodTest;
23 import com.sun.star.sheet.XViewPane;
24 import com.sun.star.table.CellRangeAddress;
26 /**
27 * Testing <code>com.sun.star.sheet.XViewPane</code>
28 * interface methods :
29 * <ul>
30 * <li><code> getFirstVisibleColumn()</code></li>
31 * <li><code> setFirstVisibleColumn()</code></li>
32 * <li><code> getFirstVisibleRow()</code></li>
33 * <li><code> setFirstVisibleRow()</code></li>
34 * <li><code> getVisibleRange()</code></li>
35 * </ul> <p>
36 * @see com.sun.star.sheet.XViewPane
38 public class _XViewPane extends MultiMethodTest {
40 public XViewPane oObj = null;
41 int row = 3;
42 int col = 5;
44 /**
45 * Test calls the method and checks returned value. <p>
46 * Has <b> OK </b> status if returned value is equal to value that was set
47 * by method <code>setFirstVisibleColumn()</code>. <p>
48 * The following method tests are to be completed successfully before :
49 * <ul>
50 * <li> <code> setFirstVisibleColumn() </code> : to set specific value
51 * of the first column that is visible in the pane </li>
52 * </ul>
54 public void _getFirstVisibleColumn() {
55 requiredMethod("setFirstVisibleColumn()");
56 boolean result = col == oObj.getFirstVisibleColumn();
57 tRes.tested("getFirstVisibleColumn()", result);
60 /**
61 * Test calls the method and checks returned value. <p>
62 * Has <b> OK </b> status if returned value is equal to value that was set
63 * by method <code>setFirstVisibleRow()</code>. <p>
64 * The following method tests are to be completed successfully before :
65 * <ul>
66 * <li> <code> setFirstVisibleRow() </code> : to set specific value of
67 * the first row that is visible in the pane </li>
68 * </ul>
70 public void _getFirstVisibleRow() {
71 requiredMethod("setFirstVisibleRow()");
72 boolean result = row == oObj.getFirstVisibleRow();
73 tRes.tested("getFirstVisibleRow()", result);
76 /**
77 * Test just calls the method. <p>
78 * Has <b> OK </b> status if the method successfully returns. <p>
80 public void _setFirstVisibleColumn() {
81 oObj.setFirstVisibleColumn(col);
82 tRes.tested("setFirstVisibleColumn()", true);
85 /**
86 * Test just calls the method. <p>
87 * Has <b> OK </b> status if the method successfully returns. <p>
89 public void _setFirstVisibleRow() {
90 oObj.setFirstVisibleRow(row);
91 tRes.tested("setFirstVisibleRow()", true);
94 /**
95 * Test calls the method, checks returned value and adds object relation
96 * 'DATAAREA' to test environment. <p>
97 * Has <b> OK </b> status if returned value isn't null and if start row and
98 * start column are equal to values that was set by methods
99 * <code>setFirstVisibleRow</code> and <code>setFirstVisibleColumn</code>.<p>
100 * The following method tests are to be completed successfully before :
101 * <ul>
102 * <li> <code> setFirstVisibleRow() </code> : to set specific value of
103 * the first row that is visible in the pane </li>
104 * <li> <code> setFirstVisibleColumn() </code> : to set specific value of
105 * the first column that is visible in the pane </li>
106 * </ul>
108 public void _getVisibleRange() {
109 requiredMethod("setFirstVisibleRow()");
110 requiredMethod("setFirstVisibleColumn()");
112 CellRangeAddress RA = oObj.getVisibleRange();
113 boolean result = RA != null;
114 if (result) {
115 result &= RA.Sheet == 0;
116 result &= RA.StartRow == row;
117 result &= RA.StartColumn == col;
118 tEnv.addObjRelation("DATAAREA", RA);
121 tRes.tested("getVisibleRange()", result);