2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.sheet
.GeneralFunction
;
24 import com
.sun
.star
.sheet
.SubTotalColumn
;
25 import com
.sun
.star
.sheet
.XSubTotalField
;
28 * Testing <code>com.sun.star.sheet.XSubTotalField</code>
31 * <li><code> getGroupColumn()</code></li>
32 * <li><code> setGroupColumn()</code></li>
33 * <li><code> getSubTotalColumns()</code></li>
34 * <li><code> setSubTotalColumns()</code></li>
36 * @see com.sun.star.sheet.XSubTotalField
38 public class _XSubTotalField
extends MultiMethodTest
{
40 public XSubTotalField oObj
= null;
41 public int GroupColumn
= 0;
42 public SubTotalColumn
[] STColumns
= null;
45 * Test calls the method, stores and checks returned value. <p>
46 * Has <b> OK </b> status if returned value isn't equal to zero. <p>
48 public void _getGroupColumn() {
49 GroupColumn
= oObj
.getGroupColumn();
50 tRes
.tested("getGroupColumn()", GroupColumn
!= 0);
51 } // end of getGroupColumn
54 * Test calls the method, stores and checks returned value. <p>
55 * Has <b> OK </b> status if returned value isn't null. <p>
57 public void _getSubTotalColumns() {
58 STColumns
= oObj
.getSubTotalColumns();
59 tRes
.tested("getSubTotalColumns()", STColumns
!= null);
60 } // end of getSubTotalColumns
63 * Test sets new value of the column by which entries are grouped,
64 * gets the current value and compares
65 * returned value with value that was stored by method
66 * <code>getGroupColumn()</code>. <p>
67 * Has <b> OK </b> status if values aren't equal. <p>
68 * The following method tests are to be completed successfully before :
70 * <li> <code> getGroupColumn() </code> : to have the current column by
71 * which entries are grouped </li>
74 public void _setGroupColumn() {
75 requiredMethod("getGroupColumn()");
76 oObj
.setGroupColumn(2);
77 tRes
.tested("setGroupColumn()", GroupColumn
!= oObj
.getGroupColumn());
78 } // end of getGroupColumn
81 * Test sets new value using method, gets the current value and compares
82 * returned value with value that was stored by method
83 * <code>getSubTotalColumns()</code>. <p>
84 * Has <b> OK </b> status if values aren't equal. <p>
85 * The following method tests are to be completed successfully before :
87 * <li> <code> getSubTotalColumns() </code> : to have the current value</li>
90 public void _setSubTotalColumns() {
91 requiredMethod("getSubTotalColumns()");
92 SubTotalColumn
[] columns
= new SubTotalColumn
[2];
93 SubTotalColumn column
= new SubTotalColumn();
95 column
.Function
=GeneralFunction
.AVERAGE
;
97 columns
[1]=STColumns
[0];
98 oObj
.setSubTotalColumns(columns
);
100 "setSubTotalColumns()",
101 !STColumns
.equals(oObj
.getSubTotalColumns()) );
102 } // end of getSubTotalColumns
104 } // finish class _XSubTotalField