1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
30 import lib
.MultiMethodTest
;
31 import util
.ValueComparer
;
33 import com
.sun
.star
.sheet
.XLabelRange
;
34 import com
.sun
.star
.table
.CellRangeAddress
;
37 * Testing <code>com.sun.star.sheet.XLabelRange</code>
40 * <li><code> getLabelArea()</code></li>
41 * <li><code> setLabelArea()</code></li>
42 * <li><code> getDataArea()</code></li>
43 * <li><code> setDataArea()</code></li>
45 * @see com.sun.star.sheet.XLabelRange
47 public class _XLabelRange
extends MultiMethodTest
{
49 public XLabelRange oObj
= null;
50 public CellRangeAddress setDAddress
= null;
51 public CellRangeAddress setLAddress
= null;
54 * Test creates and stores <code>CellRangeAddress</code>, calls the method.
55 * <p>Has <b> OK </b> status if the method successfully returns. <p>
56 * @see com.sun.star.table.CellRangeAddress
58 public void _setDataArea() {
59 int nr
= Thread
.activeCount();
60 setDAddress
= new CellRangeAddress((short)1, nr
, 1, nr
, 8);
61 oObj
.setDataArea(setDAddress
);
62 tRes
.tested("setDataArea()", true);
66 * Test creates and stores <code>CellRangeAddress</code>, calls the method.
67 * <p>Has <b> OK </b> status if the method successfully returns. <p>
68 * @see com.sun.star.table.CellRangeAddress
70 public void _setLabelArea() {
71 int nr
= Thread
.activeCount();
72 setLAddress
= new CellRangeAddress((short)1, nr
, 0, nr
, 0);
73 oObj
.setLabelArea(setLAddress
);
74 tRes
.tested("setLabelArea()", true);
78 * Test calls the method and compares returned value with value that was set.
79 * <p>Has <b> OK </b> status if values are equal. <p>
80 * The following method tests are to be completed successfully before :
82 * <li> <code> setDataArea() </code> : to have address of the cell range for
83 * which the labels are valid</li>
86 public void _getDataArea() {
87 requiredMethod("setDataArea()");
88 CellRangeAddress gA
= oObj
.getDataArea();
89 tRes
.tested("getDataArea()", ValueComparer
.equalValue(gA
, setDAddress
));
93 * Test calls the method and compares returned value with value set before.
94 * <p>Has <b> OK </b> status if if values are equal. <p>
95 * The following method tests are to be completed successfully before :
97 * <li> <code> setLabelArea() </code>: to have the cell range that contains
101 public void _getLabelArea() {
102 requiredMethod("setLabelArea()");
103 CellRangeAddress gA1
= oObj
.getLabelArea();
104 tRes
.tested("getLabelArea()",
105 ValueComparer
.equalValue(gA1
, setLAddress
));
107 } // finish class _XLabelRange