1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.sheet;
29 
30 import lib.MultiMethodTest;
31 
32 import com.sun.star.sheet.XViewSplitable;
33 
34 /**
35 * Testing <code>com.sun.star.sheet.XViewSplitable</code>
36 * interface methods :
37 * <ul>
38 *  <li><code> getIsWindowSplit()</code></li>
39 *  <li><code> getSplitHorizontal()</code></li>
40 *  <li><code> getSplitVertical()</code></li>
41 *  <li><code> getSplitColumn()</code></li>
42 *  <li><code> getSplitRow()</code></li>
43 *  <li><code> splitAtPosition()</code></li>
44 * </ul> <p>
45 * @see com.sun.star.sheet.XViewSplitable
46 */
47 public class _XViewSplitable extends MultiMethodTest {
48 
49     public XViewSplitable oObj = null;
50     protected final int posX = 101, posY = 51;
51 
52     /**
53     * Test just calls the method. <p>
54     * Has <b> OK </b> status if the method successfully returns. <p>
55     */
56     public void _splitAtPosition(){
57         oObj.splitAtPosition(posX, posY);
58         tRes.tested("splitAtPosition()", true);
59     }
60 
61     /**
62     * Test calls the method and checks returned value. <p>
63     * Has <b> OK </b> status if returned value is equal to true. <p>
64     * The following method tests are to be completed successfully before :
65     * <ul>
66     *  <li> <code> splitAtPosition() </code> : that the view was splitted into
67     *   individual panes </li>
68     * </ul>
69     */
70     public void _getIsWindowSplit(){
71         requiredMethod("splitAtPosition()");
72         tRes.tested("getIsWindowSplit()", oObj.getIsWindowSplit());
73     }
74 
75     /**
76     * Test calls the method and compares returned value with value that was
77     * set by method <code>splitAtPosition()</code>. <p>
78     * Has <b> OK </b> status if returned value is equal to value that was
79     * set by method <code>splitAtPosition()</code>. <p>
80     * The following method tests are to be completed successfully before :
81     * <ul>
82     *  <li> <code> splitAtPosition() </code> : to split the view at the
83     *  specified position </li>
84     * </ul>
85     */
86     public void _getSplitHorizontal() {
87         requiredMethod("splitAtPosition()");
88         tRes.tested("getSplitHorizontal()", oObj.getSplitHorizontal() == posX);
89     }
90 
91     /**
92     * Test calls the method and compares returned value with value that was
93     * set by method <code>splitAtPosition()</code>. <p>
94     * Has <b> OK </b> status if returned value is equal to value that was
95     * set by method <code>splitAtPosition()</code>. <p>
96     * The following method tests are to be completed successfully before :
97     * <ul>
98     *  <li> <code> splitAtPosition() </code> : to split the view at the
99     *  specified position </li>
100     * </ul>
101     */
102     public void _getSplitVertical() {
103         requiredMethod("splitAtPosition()");
104         tRes.tested("getSplitVertical()", oObj.getSplitVertical() == posY);
105     }
106 
107     /**
108     * Test calls the method and checks returned value. <p>
109     * Has <b> OK </b> status if returned value isn't equal zero. <p>
110     * The following method tests are to be completed successfully before :
111     * <ul>
112     *  <li> <code> splitAtPosition() </code> : to split the view at the
113     *  specified position </li>
114     * </ul>
115     */
116     public void _getSplitColumn() {
117         requiredMethod("splitAtPosition()");
118         tRes.tested("getSplitColumn()", oObj.getSplitColumn() != 0);
119     }
120 
121     /**
122     * Test calls the method and checks returned value. <p>
123     * Has <b> OK </b> status if returned value isn't equal zero. <p>
124     * The following method tests are to be completed successfully before :
125     * <ul>
126     *  <li> <code> splitAtPosition() </code> : to split the view at the
127     *  specified position </li>
128     * </ul>
129     */
130     public void _getSplitRow() {
131         requiredMethod("splitAtPosition()");
132         tRes.tested("getSplitRow()", oObj.getSplitRow() != 0);
133     }
134 }  // finish class _XViewSplitable
135 
136 
137