Bump version to 5.0-14
[LibreOffice.git] / sc / qa / complex / dataPilot / _XDataPilotTable.java
blob1856413caa9883dfeb9b4b6780d0026d2c594044
1 /*
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;
27 /**
28 * Testing <code>com.sun.star.sheet.XDataPilotTable</code>
29 * interface methods :
30 * <ul>
31 * <li><code> getOutputRange()</code></li>
32 * <li><code> refresh()</code></li>
33 * </ul> <p>
34 * This test needs the following object relations :
35 * <ul>
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
42 * call) </li><ul> <p>
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;
54 /**
55 * The test parameters
57 private final TestParameters param;
59 /**
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) {
67 oObj = xObj;
68 this.param = 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");
80 return false;
82 return true;
84 /**
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;
95 return bResult;