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 package ifc.sheet;
24 
25 import com.sun.star.sheet.GeneralFunction;
26 import com.sun.star.sheet.SubTotalColumn;
27 import com.sun.star.sheet.XSubTotalDescriptor;
28 
29 import lib.MultiMethodTest;
30 
31 
32 /**
33 * Testing <code>com.sun.star.sheet.XSubTotalDescriptor</code>
34 * interface methods :
35 * <ul>
36 *  <li><code> addNew()</code></li>
37 *  <li><code> clear()</code></li>
38 * </ul> <p>
39 * @see com.sun.star.sheet.XSubTotalDescriptor
40 */
41 public class _XSubTotalDescriptor extends MultiMethodTest {
42     public XSubTotalDescriptor oObj = null;
43 
44     /**
45     * Test creates a subtotal field definition and adds it to the descriptor.<p>
46     * Has <b> OK </b> status if the method successfully returns. <p>
47     */
_addNew()48     public void _addNew() {
49         SubTotalColumn[] columns = new SubTotalColumn[1];
50         SubTotalColumn column = new SubTotalColumn();
51         column.Column = 5;
52         column.Function = GeneralFunction.SUM;
53         columns[0] = column;
54         oObj.addNew(columns, 1);
55         tRes.tested("addNew()", true);
56     }
57 
58     /**
59     * Test just calls the method. <p>
60     * Has <b> OK </b> status if the method successfully returns. <p>
61     */
_clear()62     public void _clear() {
63         oObj.clear();
64         tRes.tested("clear()", true);
65     }
66 
67     /**
68     * Forces environment recreation.
69     */
after()70     protected void after() {
71         disposeEnvironment();
72     }
73 } // finish class _XSubTotalDescriptor
74