Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / sheet / _XLabelRange.java
blob8ee1dc81912083e47b669d3e749a016b83ad99ac
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XLabelRange.java,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package ifc.sheet;
33 import lib.MultiMethodTest;
34 import util.ValueComparer;
36 import com.sun.star.sheet.XLabelRange;
37 import com.sun.star.table.CellRangeAddress;
39 /**
40 * Testing <code>com.sun.star.sheet.XLabelRange</code>
41 * interface methods :
42 * <ul>
43 * <li><code> getLabelArea()</code></li>
44 * <li><code> setLabelArea()</code></li>
45 * <li><code> getDataArea()</code></li>
46 * <li><code> setDataArea()</code></li>
47 * </ul> <p>
48 * @see com.sun.star.sheet.XLabelRange
50 public class _XLabelRange extends MultiMethodTest {
52 public XLabelRange oObj = null;
53 public CellRangeAddress setDAddress = null;
54 public CellRangeAddress setLAddress = null;
56 /**
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 _setDataArea() {
62 int nr = Thread.activeCount();
63 setDAddress = new CellRangeAddress((short)1, nr, 1, nr, 8);
64 oObj.setDataArea(setDAddress);
65 tRes.tested("setDataArea()", true);
68 /**
69 * Test creates and stores <code>CellRangeAddress</code>, calls the method.
70 * <p>Has <b> OK </b> status if the method successfully returns. <p>
71 * @see com.sun.star.table.CellRangeAddress
73 public void _setLabelArea() {
74 int nr = Thread.activeCount();
75 setLAddress = new CellRangeAddress((short)1, nr, 0, nr, 0);
76 oObj.setLabelArea(setLAddress);
77 tRes.tested("setLabelArea()", true);
80 /**
81 * Test calls the method and compares returned value with value that was set.
82 * <p>Has <b> OK </b> status if values are equal. <p>
83 * The following method tests are to be completed successfully before :
84 * <ul>
85 * <li> <code> setDataArea() </code> : to have address of the cell range for
86 * which the labels are valid</li>
87 * </ul>
89 public void _getDataArea() {
90 requiredMethod("setDataArea()");
91 CellRangeAddress gA = oObj.getDataArea();
92 tRes.tested("getDataArea()", ValueComparer.equalValue(gA, setDAddress));
95 /**
96 * Test calls the method and compares returned value with value set before.
97 * <p>Has <b> OK </b> status if if values are equal. <p>
98 * The following method tests are to be completed successfully before :
99 * <ul>
100 * <li> <code> setLabelArea() </code>: to have the cell range that contains
101 * the labels</li>
102 * </ul>
104 public void _getLabelArea() {
105 requiredMethod("setLabelArea()");
106 CellRangeAddress gA1 = oObj.getLabelArea();
107 tRes.tested("getLabelArea()",
108 ValueComparer.equalValue(gA1, setLAddress));
110 } // finish class _XLabelRange