summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2019-03-10 02:23:56 +0000
committerJens Carl <j.carl43@gmx.de>2019-03-10 07:14:51 +0100
commit57ca3b3b2b4f40b1792ea7be7d0543f3036926ef (patch)
tree538ebbc69309b7e61ead47698e65c4984bb135dc /qadevOOo
parentb0a1e1c8191123aa7644cdb28f7f6a07dc2a61f7 (diff)
tdf#45904 Move XTableCharts Java tests to C++
Move XTableCharts Java tests to C++ for ScChartsObj. Change-Id: Ibd08cc60d38d8ca01af9168d862a9f391c48e90a Reviewed-on: https://gerrit.libreoffice.org/68992 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/Jar_OOoRunner.mk2
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartsObj.csv2
-rw-r--r--qadevOOo/tests/java/ifc/table/_XTableCharts.java85
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScChartsObj.java234
4 files changed, 0 insertions, 323 deletions
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index d592ff21e77a..e9824a003db6 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -587,7 +587,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/table/_XAutoFormattable \
qadevOOo/tests/java/ifc/table/_XCellRange \
qadevOOo/tests/java/ifc/table/_XTableChart \
- qadevOOo/tests/java/ifc/table/_XTableCharts \
qadevOOo/tests/java/ifc/table/_XTableColumns \
qadevOOo/tests/java/ifc/table/_XTableRows \
qadevOOo/tests/java/ifc/task/_XInteractionHandler \
@@ -960,7 +959,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/mod/_sc/ScCellRangesObj \
qadevOOo/tests/java/mod/_sc/ScCellSearchObj \
qadevOOo/tests/java/mod/_sc/ScCellTextCursor \
- qadevOOo/tests/java/mod/_sc/ScChartsObj \
qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj \
qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj \
qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartsObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartsObj.csv
deleted file mode 100644
index 3efd1952c17a..000000000000
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartsObj.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-"ScChartsObj";"com::sun::star::table::XTableCharts";"addNewByName()"
-"ScChartsObj";"com::sun::star::table::XTableCharts";"removeByName()"
diff --git a/qadevOOo/tests/java/ifc/table/_XTableCharts.java b/qadevOOo/tests/java/ifc/table/_XTableCharts.java
deleted file mode 100644
index 62f939d7a0ac..000000000000
--- a/qadevOOo/tests/java/ifc/table/_XTableCharts.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.table;
-
-import lib.MultiMethodTest;
-
-import com.sun.star.awt.Rectangle;
-import com.sun.star.table.CellRangeAddress;
-import com.sun.star.table.XTableCharts;
-
-/**
-* Testing <code>com.sun.star.table.XTableCharts</code>
-* interface methods :
-* <ul>
-* <li><code> addNewByName()</code></li>
-* <li><code> removeByName()</code></li>
-* </ul> <p>
-* This test needs the following object relations :
-* <ul>
-* <li> <code>'ADDR'</code>
-* (of type <code>com.sun.star.table.CellRangeAddress[]</code>):
-* data source ranges for chart creating. </li>
-* <li> <code>'RECT'</code>
-* (of type <code>com.sun.star.awt.Rectangle</code>):
-* the position of chart </li>
-* <ul> <p>
-* Test is <b> NOT </b> multithread compliant. <p>
-* @see com.sun.star.table.XTableCharts
-*/
-public class _XTableCharts extends MultiMethodTest {
-
- public XTableCharts oObj = null;
-
- /**
- * Adds a new chart into table with specified name . <p>
- * Has <b> OK </b> status if <code>hasByName()</code> returns
- * <code>true</code>. <p>
- */
- public void _addNewByName() {
-
- CellRangeAddress[] the_Range = (CellRangeAddress[])
- tEnv.getObjRelation("ADDR");
- Rectangle the_rect = (Rectangle) tEnv.getObjRelation("RECT");
- oObj.addNewByName("XTableCharts",the_rect,the_Range,true,true);
- tRes.tested("addNewByName()", oObj.hasByName("XTableCharts") );
-
- } // addNewByName()
-
- /**
- * Removes the chart added before. <p>
- * Has <b> OK </b> status if <code>hasByName()</code> returns
- * <code>false</code>. <p>
- * The following method tests are to be completed successfully before :
- * <ul>
- * <li> <code> addNewByName() </code> : chart must be added first </li>
- * </ul>
- */
- public void _removeByName() {
- requiredMethod("addNewByName()") ;
-
- oObj.removeByName("XTableCharts");
- tRes.tested("removeByName()", !oObj.hasByName("XTableCharts") );
-
- } // removeByName()
-
-} // finish class _XTableCharts
-
-
-
diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java
deleted file mode 100644
index f488216ffc92..000000000000
--- a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.SOfficeFactory;
-
-import com.sun.star.awt.Rectangle;
-import com.sun.star.container.XIndexAccess;
-import com.sun.star.lang.XComponent;
-import com.sun.star.sheet.XCellRangeAddressable;
-import com.sun.star.sheet.XSpreadsheet;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.sheet.XSpreadsheets;
-import com.sun.star.table.CellRangeAddress;
-import com.sun.star.table.XCell;
-import com.sun.star.table.XCellRange;
-import com.sun.star.table.XTableCharts;
-import com.sun.star.table.XTableChartsSupplier;
-import com.sun.star.uno.AnyConverter;
-import com.sun.star.uno.Type;
-import com.sun.star.uno.UnoRuntime;
-
-/**
-* Test for object which is represented by service
-* <code>com.sun.star.table.TableCharts</code>. <p>
-* Object implements the following interfaces :
-* <ul>
-* <li> <code>com::sun::star::container::XNameAccess</code></li>
-* <li> <code>com::sun::star::container::XIndexAccess</code></li>
-* <li> <code>com::sun::star::container::XElementAccess</code></li>
-* <li> <code>com::sun::star::table::XTableCharts</code></li>
-* </ul>
-* @see com.sun.star.table.TableCharts
-* @see com.sun.star.container.XNameAccess
-* @see com.sun.star.container.XIndexAccess
-* @see com.sun.star.container.XElementAccess
-* @see com.sun.star.table.XTableCharts
-* @see ifc.container._XNameAccess
-* @see ifc.container._XIndexAccess
-* @see ifc.container._XElementAccess
-* @see ifc.table._XTableCharts
-*/
-public class ScChartsObj extends TestCase {
- private XSpreadsheetDocument xSheetDoc = null;
-
- /**
- * Creates Spreadsheet document.
- */
- @Override
- protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
- // get a soffice factory object
- SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
- log.println( "creating a sheetdocument" );
- xSheetDoc = SOF.createCalcDoc(null);
- }
-
- /**
- * Disposes Spreadsheet document.
- */
- @Override
- protected void cleanup( TestParameters tParam, PrintWriter log ) {
- log.println( " disposing xSheetDoc " );
- XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc);
- util.DesktopTools.closeDoc(oComp);
- }
-
- /**
- * Creating a TestEnvironment for the interfaces to be tested.
- * Retrieves a collection of spreadsheets from a document
- * and takes one of them. Inserts some values into the cells of the same cell
- * range address. Obtains the collection of the charts using the interface
- * <code>XTableChartsSupplier</code>. Creates and adds the chart that using
- * the data from the cells of this cell range address. Collection of
- * the charts is the instance of the service
- * <code>com.sun.star.table.TableCharts</code>.
- * Object relations created :
- * <ul>
- * <li> <code>'RECT'</code> for
- * {@link ifc.table._XTableCharts}(of type <code>Rectangle</code>
- * the position of the chart)</li>
- * <li> <code>'ADDR'</code> for
- * {@link ifc.table._XTableCharts}(of type
- * <code>com.sun.star.table.CellRangeAddress[]</code> data source ranges
- * for chart creating)</li>
- * </ul>
- * @see com.sun.star.container.XNamed
- * @see com.sun.star.table.XTableChartsSupplier
- */
- @Override
- protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
-
- XSpreadsheet oSheet=null;
-
- log.println("Getting spreadsheet") ;
- XSpreadsheets oSheets = xSheetDoc.getSheets() ;
- XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
- oSheet = (XSpreadsheet) AnyConverter.toObject(
- new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
-
- log.println("Creating the Header") ;
-
- insertIntoCell(1,0,"JAN",oSheet,"");
- insertIntoCell(2,0,"FEB",oSheet,"");
- insertIntoCell(3,0,"MAR",oSheet,"");
- insertIntoCell(4,0,"APR",oSheet,"");
- insertIntoCell(5,0,"MAI",oSheet,"");
- insertIntoCell(6,0,"JUN",oSheet,"");
- insertIntoCell(7,0,"JUL",oSheet,"");
- insertIntoCell(8,0,"AUG",oSheet,"");
- insertIntoCell(9,0,"SEP",oSheet,"");
- insertIntoCell(10,0,"OCT",oSheet,"");
- insertIntoCell(11,0,"NOV",oSheet,"");
- insertIntoCell(12,0,"DEC",oSheet,"");
- insertIntoCell(13,0,"SUM",oSheet,"");
-
- log.println("Fill the lines");
-
- insertIntoCell(0,1,"Smith",oSheet,"");
- insertIntoCell(1,1,"42",oSheet,"V");
- insertIntoCell(2,1,"58.9",oSheet,"V");
- insertIntoCell(3,1,"-66.5",oSheet,"V");
- insertIntoCell(4,1,"43.4",oSheet,"V");
- insertIntoCell(5,1,"44.5",oSheet,"V");
- insertIntoCell(6,1,"45.3",oSheet,"V");
- insertIntoCell(7,1,"-67.3",oSheet,"V");
- insertIntoCell(8,1,"30.5",oSheet,"V");
- insertIntoCell(9,1,"23.2",oSheet,"V");
- insertIntoCell(10,1,"-97.3",oSheet,"V");
- insertIntoCell(11,1,"22.4",oSheet,"V");
- insertIntoCell(12,1,"23.5",oSheet,"V");
- insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");
-
- insertIntoCell(0,2,"Jones",oSheet,"");
- insertIntoCell(1,2,"21",oSheet,"V");
- insertIntoCell(2,2,"40.9",oSheet,"V");
- insertIntoCell(3,2,"-57.5",oSheet,"V");
- insertIntoCell(4,2,"-23.4",oSheet,"V");
- insertIntoCell(5,2,"34.5",oSheet,"V");
- insertIntoCell(6,2,"59.3",oSheet,"V");
- insertIntoCell(7,2,"27.3",oSheet,"V");
- insertIntoCell(8,2,"-38.5",oSheet,"V");
- insertIntoCell(9,2,"43.2",oSheet,"V");
- insertIntoCell(10,2,"57.3",oSheet,"V");
- insertIntoCell(11,2,"25.4",oSheet,"V");
- insertIntoCell(12,2,"28.5",oSheet,"V");
- insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");
-
- insertIntoCell(0,3,"Brown",oSheet,"");
- insertIntoCell(1,3,"31.45",oSheet,"V");
- insertIntoCell(2,3,"-20.9",oSheet,"V");
- insertIntoCell(3,3,"-117.5",oSheet,"V");
- insertIntoCell(4,3,"23.4",oSheet,"V");
- insertIntoCell(5,3,"-114.5",oSheet,"V");
- insertIntoCell(6,3,"115.3",oSheet,"V");
- insertIntoCell(7,3,"-171.3",oSheet,"V");
- insertIntoCell(8,3,"89.5",oSheet,"V");
- insertIntoCell(9,3,"41.2",oSheet,"V");
- insertIntoCell(10,3,"71.3",oSheet,"V");
- insertIntoCell(11,3,"25.4",oSheet,"V");
- insertIntoCell(12,3,"38.5",oSheet,"V");
- insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");
-
- // insert a chart
- Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);
-
- XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet);
- XCellRange myRange = oRange.getCellRangeByName("A1:N4");
- XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
- CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
-
- CellRangeAddress[] oAddr = new CellRangeAddress[1];
- oAddr[0] = myAddr;
- XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);
-
-
- log.println("Insert Chart");
- XTableCharts oCharts = oSupp.getCharts();
- oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true);
-
- log.println("creating a new environment for object");
- TestEnvironment tEnv = new TestEnvironment(oCharts);
-
- tEnv.addObjRelation("RECT", oRect);
- tEnv.addObjRelation("ADDR", oAddr);
-
- return tEnv;
- }
-
- /**
- * Inserts a value or a formula in the cell of the spreasheet.
- * @param CellX is the column index of the cell
- * @param CellY is the row index of the cell
- * @param theValue string representation of the value
- * @param TT1 specify the spreadsheet, the interface
- * <code>com.sun.star.sheet.XSpreadsheet</code>
- * @param flag if it's equal to <code>'V'</code> then the method inserts
- * a double-value in the cell else it inserts a formula in the cell
- */
- public static void insertIntoCell(
- int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag)
- throws com.sun.star.lang.IndexOutOfBoundsException {
-
- XCell oCell = TT1.getCellByPosition(CellX, CellY);
-
- if (flag.equals("V")) {
- oCell.setValue(Float.parseFloat(theValue));
- } else {
- oCell.setFormula(theValue);
- }
-
- } // end of insertIntoCell
-}
-