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
;
22 import util
.ValueComparer
;
24 import com
.sun
.star
.sheet
.XLabelRange
;
25 import com
.sun
.star
.table
.CellRangeAddress
;
28 * Testing <code>com.sun.star.sheet.XLabelRange</code>
31 * <li><code> getLabelArea()</code></li>
32 * <li><code> setLabelArea()</code></li>
33 * <li><code> getDataArea()</code></li>
34 * <li><code> setDataArea()</code></li>
36 * @see com.sun.star.sheet.XLabelRange
38 public class _XLabelRange
extends MultiMethodTest
{
40 public XLabelRange oObj
= null;
41 public CellRangeAddress setDAddress
= null;
42 public CellRangeAddress setLAddress
= null;
45 * Test creates and stores <code>CellRangeAddress</code>, calls the method.
46 * <p>Has <b> OK </b> status if the method successfully returns. <p>
47 * @see com.sun.star.table.CellRangeAddress
49 public void _setDataArea() {
50 int nr
= Thread
.activeCount();
51 setDAddress
= new CellRangeAddress((short)1, nr
, 1, nr
, 8);
52 oObj
.setDataArea(setDAddress
);
53 tRes
.tested("setDataArea()", true);
57 * Test creates and stores <code>CellRangeAddress</code>, calls the method.
58 * <p>Has <b> OK </b> status if the method successfully returns. <p>
59 * @see com.sun.star.table.CellRangeAddress
61 public void _setLabelArea() {
62 int nr
= Thread
.activeCount();
63 setLAddress
= new CellRangeAddress((short)1, nr
, 0, nr
, 0);
64 oObj
.setLabelArea(setLAddress
);
65 tRes
.tested("setLabelArea()", true);
69 * Test calls the method and compares returned value with value that was set.
70 * <p>Has <b> OK </b> status if values are equal. <p>
71 * The following method tests are to be completed successfully before :
73 * <li> <code> setDataArea() </code> : to have address of the cell range for
74 * which the labels are valid</li>
77 public void _getDataArea() {
78 requiredMethod("setDataArea()");
79 CellRangeAddress gA
= oObj
.getDataArea();
80 tRes
.tested("getDataArea()", ValueComparer
.equalValue(gA
, setDAddress
));
84 * Test calls the method and compares returned value with value set before.
85 * <p>Has <b> OK </b> status if values are equal. <p>
86 * The following method tests are to be completed successfully before :
88 * <li> <code> setLabelArea() </code>: to have the cell range that contains
92 public void _getLabelArea() {
93 requiredMethod("setLabelArea()");
94 CellRangeAddress gA1
= oObj
.getLabelArea();
95 tRes
.tested("getLabelArea()",
96 ValueComparer
.equalValue(gA1
, setLAddress
));
98 } // finish class _XLabelRange