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.table;
25 
26 import lib.MultiMethodTest;
27 import util.ValueComparer;
28 
29 import com.sun.star.table.CellRangeAddress;
30 import com.sun.star.table.XTableChart;
31 
32 /**
33 * Testing <code>com.sun.star.table.XTableChart</code>
34 * interface methods :
35 * <ul>
36 *  <li><code> getHasColumnHeaders()</code></li>
37 *  <li><code> setHasColumnHeaders()</code></li>
38 *  <li><code> getHasRowHeaders()</code></li>
39 *  <li><code> setHasRowHeaders()</code></li>
40 *  <li><code> getRanges()</code></li>
41 *  <li><code> setRanges()</code></li>
42 * </ul> <p>
43 * Test is <b> NOT </b> multithread compilant. <p>
44 * @see com.sun.star.table.XTableChart
45 */
46 public class _XTableChart extends MultiMethodTest {
47 
48     public XTableChart oObj = null;
49 
50     /**
51      * Sets the property to <code>false</code> and then check it. <p>
52      * Has <b> OK </b> status if the method returns <code>false</code>. <p>
53      */
_getHasColumnHeaders()54     public void _getHasColumnHeaders() {
55         oObj.setHasColumnHeaders(false);
56         tRes.tested("getHasColumnHeaders()", !oObj.getHasColumnHeaders() );
57     } // getHasColumnHeaders()
58 
59     /**
60      * Sets the property to <code>true</code> and then check it. <p>
61      * Has <b> OK </b> status if the method returns <code>true</code>. <p>
62      */
_setHasColumnHeaders()63     public void _setHasColumnHeaders() {
64         oObj.setHasColumnHeaders(true);
65         tRes.tested("setHasColumnHeaders()", oObj.getHasColumnHeaders() );
66     } // setHasColumnHeaders()
67 
68     /**
69      * Sets the property to <code>false</code> and then check it. <p>
70      * Has <b> OK </b> status if the method returns <code>false</code>. <p>
71      */
_getHasRowHeaders()72     public void _getHasRowHeaders() {
73         oObj.setHasRowHeaders(false);
74         tRes.tested("getHasRowHeaders()", !oObj.getHasRowHeaders() );
75     } // getHasRowHeaders()
76 
77     /**
78      * Sets the property to <code>true</code> and then check it. <p>
79      * Has <b> OK </b> status if the method returns <code>true</code>. <p>
80      */
_setHasRowHeaders()81     public void _setHasRowHeaders() {
82         oObj.setHasRowHeaders(true);
83         tRes.tested("setHasRowHeaders()", oObj.getHasRowHeaders() );
84     } // setHasRowHeaders()
85 
86     CellRangeAddress[] the_Ranges = null;
87 
88     /**
89      * Test calls the method and stores the range returned. <p>
90      * Has <b> OK </b> status if the method returns not
91      * <code>null</code> valuie. <p>
92      */
_getRanges()93     public void _getRanges() {
94         the_Ranges = oObj.getRanges();
95         tRes.tested("getRanges()", the_Ranges != null );
96      } // getRanges()
97 
98     /**
99      * Changes the first range in range array obtained by
100      * <code>getRanges</code> method, then set changed array. <p>
101      * Has <b> OK </b> status if range array get is the same as was
102      * set. <p>
103      * The following method tests are to be completed successfully before :
104      * <ul>
105      *  <li> <code> getRanges() </code> : to have initial ranges </li>
106      * </ul>
107      */
_setRanges()108     public void _setRanges() {
109         requiredMethod("getRanges()");
110         CellRangeAddress[] tmpRanges = oObj.getRanges();
111         tmpRanges[0].EndRow = 1;
112         oObj.setRanges(tmpRanges);
113         tRes.tested("setRanges()", ValueComparer.equalValue(
114                                                 tmpRanges,oObj.getRanges()));
115         oObj.setRanges(the_Ranges);
116      } // getRanges()
117 
118 } // finish class _XTableChartsSupplier
119 
120 
121 
122