fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sc / qa / complex / dataPilot / _XDataPilotTable.java
blobc653bc736388a76be513e1a63f4d89869f8b0156
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.Status;
26 //import lib.StatusException;
27 import lib.TestParameters;
28 // import share.LogWriter;
30 /**
31 * Testing <code>com.sun.star.sheet.XDataPilotTable</code>
32 * interface methods :
33 * <ul>
34 * <li><code> getOutputRange()</code></li>
35 * <li><code> refresh()</code></li>
36 * </ul> <p>
37 * This test needs the following object relations :
38 * <ul>
39 * <li> <code>'OUTPUTRANGE'</code> (of type <code>CellAddress</code>):
40 * to check value returned by method <code>getOutputRange()</code> </li>
41 * <li> <code>'CELLFORCHANGE'</code> (of type <code>XCell</code>):
42 * to check the method refresh(value of this cell will be changed)</li>
43 * <li> <code>'CELLFORCHECK'</code> (of type <code>XCell</code>):
44 * to check the method refresh (value of this cell must be changed after refresh
45 * call) </li><ul> <p>
46 * @see com.sun.star.sheet.XDataPilotTable
47 * @see com.sun.star.table.CellAddress
49 public class _XDataPilotTable {
51 public XDataPilotTable oObj = null;
52 XCell xCellForChange = null;
53 XCell xCellForCheck = null;
54 CellAddress OutputRange = null;
55 int changeValue = 0;
57 /**
58 * The test parameters
60 private TestParameters param = null;
62 /**
63 * The log writer
65 // private LogWriter log = null;
67 /**
68 * Constructor: gets the object to test, a logger and the test parameters
69 * @param xObj The test object
71 * @param param The test parameters
73 public _XDataPilotTable(XDataPilotTable xObj/*,
74 LogWriter log*/, TestParameters param) {
75 oObj = xObj;
76 // this.log = log;
77 this.param = param;
80 public boolean before() {
81 xCellForChange = (XCell)param.get("CELLFORCHANGE");
82 xCellForCheck = (XCell)param.get("CELLFORCHECK");
83 OutputRange = (CellAddress)param.get("OUTPUTRANGE");
84 changeValue = ((Integer)param.get("CHANGEVALUE")).intValue();
86 if (xCellForChange == null || OutputRange == null ||
87 xCellForCheck == null) {
88 System.out.println("Relation not found");
89 return false;
91 return true;
93 /**
94 * Test calls the method and checks returned value using value obtained by
95 * object relation <code>'OUTPUTRANGE'</code>. <p>
96 * Has <b> OK </b> status if values are equal. <p>
97 * @return
99 public boolean _getOutputRange(){
100 boolean bResult = true;
101 CellRangeAddress objRange = oObj.getOutputRange();
102 bResult &= OutputRange.Sheet == objRange.Sheet;
103 bResult &= OutputRange.Row == objRange.StartRow;
104 bResult &= OutputRange.Column == objRange.StartColumn;
105 return bResult;
109 * Test sets new value of the cell obtained by object relation
110 * 'CELLFORCHANGE', and checks value of the cell obtained by object
111 * relation 'CELLFORCHECK'.<p>
112 * Has <b>OK</b> status if value of the cell obtained by object relation
113 * 'CELLFORCHECK' is changed. <p>
114 * @return
116 public boolean _refresh(){
117 xCellForChange.setValue(changeValue);
118 double oldData = xCellForCheck.getValue();
119 oObj.refresh();
120 double newData = xCellForCheck.getValue();
121 System.out.println("Old data:" + oldData + "; new data:" + newData);
123 return oldData != newData;