1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.sheet;
25 
26 import lib.MultiMethodTest;
27 
28 import com.sun.star.sheet.XViewSplitable;
29 
30 /**
31 * Testing <code>com.sun.star.sheet.XViewSplitable</code>
32 * interface methods :
33 * <ul>
34 *  <li><code> getIsWindowSplit()</code></li>
35 *  <li><code> getSplitHorizontal()</code></li>
36 *  <li><code> getSplitVertical()</code></li>
37 *  <li><code> getSplitColumn()</code></li>
38 *  <li><code> getSplitRow()</code></li>
39 *  <li><code> splitAtPosition()</code></li>
40 * </ul> <p>
41 * @see com.sun.star.sheet.XViewSplitable
42 */
43 public class _XViewSplitable extends MultiMethodTest {
44 
45     public XViewSplitable oObj = null;
46     protected final int posX = 101, posY = 51;
47 
48     /**
49     * Test just calls the method. <p>
50     * Has <b> OK </b> status if the method successfully returns. <p>
51     */
_splitAtPosition()52     public void _splitAtPosition(){
53         oObj.splitAtPosition(posX, posY);
54         tRes.tested("splitAtPosition()", true);
55     }
56 
57     /**
58     * Test calls the method and checks returned value. <p>
59     * Has <b> OK </b> status if returned value is equal to true. <p>
60     * The following method tests are to be completed successfully before :
61     * <ul>
62     *  <li> <code> splitAtPosition() </code> : that the view was splitted into
63     *   individual panes </li>
64     * </ul>
65     */
_getIsWindowSplit()66     public void _getIsWindowSplit(){
67         requiredMethod("splitAtPosition()");
68         tRes.tested("getIsWindowSplit()", oObj.getIsWindowSplit());
69     }
70 
71     /**
72     * Test calls the method and compares returned value with value that was
73     * set by method <code>splitAtPosition()</code>. <p>
74     * Has <b> OK </b> status if returned value is equal to value that was
75     * set by method <code>splitAtPosition()</code>. <p>
76     * The following method tests are to be completed successfully before :
77     * <ul>
78     *  <li> <code> splitAtPosition() </code> : to split the view at the
79     *  specified position </li>
80     * </ul>
81     */
_getSplitHorizontal()82     public void _getSplitHorizontal() {
83         requiredMethod("splitAtPosition()");
84         tRes.tested("getSplitHorizontal()", oObj.getSplitHorizontal() == posX);
85     }
86 
87     /**
88     * Test calls the method and compares returned value with value that was
89     * set by method <code>splitAtPosition()</code>. <p>
90     * Has <b> OK </b> status if returned value is equal to value that was
91     * set by method <code>splitAtPosition()</code>. <p>
92     * The following method tests are to be completed successfully before :
93     * <ul>
94     *  <li> <code> splitAtPosition() </code> : to split the view at the
95     *  specified position </li>
96     * </ul>
97     */
_getSplitVertical()98     public void _getSplitVertical() {
99         requiredMethod("splitAtPosition()");
100         tRes.tested("getSplitVertical()", oObj.getSplitVertical() == posY);
101     }
102 
103     /**
104     * Test calls the method and checks returned value. <p>
105     * Has <b> OK </b> status if returned value isn't equal zero. <p>
106     * The following method tests are to be completed successfully before :
107     * <ul>
108     *  <li> <code> splitAtPosition() </code> : to split the view at the
109     *  specified position </li>
110     * </ul>
111     */
_getSplitColumn()112     public void _getSplitColumn() {
113         requiredMethod("splitAtPosition()");
114         tRes.tested("getSplitColumn()", oObj.getSplitColumn() != 0);
115     }
116 
117     /**
118     * Test calls the method and checks returned value. <p>
119     * Has <b> OK </b> status if returned value isn't equal zero. <p>
120     * The following method tests are to be completed successfully before :
121     * <ul>
122     *  <li> <code> splitAtPosition() </code> : to split the view at the
123     *  specified position </li>
124     * </ul>
125     */
_getSplitRow()126     public void _getSplitRow() {
127         requiredMethod("splitAtPosition()");
128         tRes.tested("getSplitRow()", oObj.getSplitRow() != 0);
129     }
130 }  // finish class _XViewSplitable
131 
132 
133