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 import util.ValueComparer;
28 
29 import com.sun.star.sheet.TableFilterField;
30 import com.sun.star.sheet.XSheetFilterDescriptor;
31 
32 /**
33 * Testing <code>com.sun.star.sheet.XSheetFilterDescriptor</code>
34 * interface methods :
35 * <ul>
36 *  <li><code> getFilterFields()</code></li>
37 *  <li><code> setFilterFields()</code></li>
38 * </ul> <p>
39 * @see com.sun.star.sheet.XSheetFilterDescriptor
40 */
41 public class _XSheetFilterDescriptor extends MultiMethodTest {
42 
43     public XSheetFilterDescriptor oObj = null;
44     public TableFilterField[] TFF = null;
45 
46     /**
47     * Test calls the method, stores and checks returned value. <p>
48     * Has <b> OK </b> status if returned value isn't null. <p>
49     */
_getFilterFields()50     public void _getFilterFields(){
51         TFF = oObj.getFilterFields();
52         tRes.tested("getFilterFields()", TFF != null );
53     }
54 
55     /**
56     * Test sets new value of the definitions of the filter fields,
57     * gets the current definitions of the filter fields and compares
58     * returned value with value that was stored by method
59     * <code>getFilterFields()</code>. <p>
60     * Has <b> OK </b> status if values aren't equal. <p>
61     * The following method tests are to be completed successfully before :
62     * <ul>
63     *  <li> <code> getFilterFields() </code> : to have the current definitions
64     *  of the filter fields </li>
65     * </ul>
66     */
_setFilterFields()67     public void _setFilterFields() {
68         requiredMethod("getFilterFields()");
69         TableFilterField[] newTFF = new TableFilterField[1];
70         newTFF[0] = new TableFilterField();
71         oObj.setFilterFields(newTFF);
72         newTFF = oObj.getFilterFields();
73         tRes.tested("setFilterFields()", ! ValueComparer.equalValue(TFF, newTFF));
74     }
75 
76 }  // finish class _XSheetFilterDescriptor
77 
78 
79