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 .
19 package complex
.dataPilot
;
21 import com
.sun
.star
.sheet
.XDataPilotTable
;
22 import com
.sun
.star
.table
.CellAddress
;
23 import com
.sun
.star
.table
.CellRangeAddress
;
24 import com
.sun
.star
.table
.XCell
;
25 import lib
.TestParameters
;
28 * Testing <code>com.sun.star.sheet.XDataPilotTable</code>
31 * <li><code> getOutputRange()</code></li>
32 * <li><code> refresh()</code></li>
34 * This test needs the following object relations :
36 * <li> <code>'OUTPUTRANGE'</code> (of type <code>CellAddress</code>):
37 * to check value returned by method <code>getOutputRange()</code> </li>
38 * <li> <code>'CELLFORCHANGE'</code> (of type <code>XCell</code>):
39 * to check the method refresh(value of this cell will be changed)</li>
40 * <li> <code>'CELLFORCHECK'</code> (of type <code>XCell</code>):
41 * to check the method refresh (value of this cell must be changed after refresh
43 * @see com.sun.star.sheet.XDataPilotTable
44 * @see com.sun.star.table.CellAddress
46 public class _XDataPilotTable
{
48 private final XDataPilotTable oObj
;
49 private XCell xCellForChange
= null;
50 private XCell xCellForCheck
= null;
51 private CellAddress OutputRange
= null;
52 private int changeValue
= 0;
57 private final TestParameters param
;
60 * Constructor: gets the object to test, a logger and the test parameters
61 * @param xObj The test object
63 * @param param The test parameters
65 public _XDataPilotTable(XDataPilotTable xObj
/*,
66 LogWriter log*/, TestParameters param
) {
71 public boolean before() {
72 xCellForChange
= (XCell
)param
.get("CELLFORCHANGE");
73 xCellForCheck
= (XCell
)param
.get("CELLFORCHECK");
74 OutputRange
= (CellAddress
)param
.get("OUTPUTRANGE");
75 changeValue
= ((Integer
)param
.get("CHANGEVALUE")).intValue();
77 if (xCellForChange
== null || OutputRange
== null ||
78 xCellForCheck
== null) {
79 System
.out
.println("Relation not found");
85 * Test calls the method and checks returned value using value obtained by
86 * object relation <code>'OUTPUTRANGE'</code>. <p>
87 * Has <b> OK </b> status if values are equal. <p>
89 public boolean _getOutputRange(){
90 boolean bResult
= true;
91 CellRangeAddress objRange
= oObj
.getOutputRange();
92 bResult
&= OutputRange
.Sheet
== objRange
.Sheet
;
93 bResult
&= OutputRange
.Row
== objRange
.StartRow
;
94 bResult
&= OutputRange
.Column
== objRange
.StartColumn
;