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