qadevOOo/Jar_OOoRunner.mk | 4 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDataPilotTableObj.csv | 2 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv | 1 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv | 4 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv | 7 qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java | 97 --- qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java | 316 ---------- qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java | 137 ---- qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java | 50 - 9 files changed, 618 deletions(-)
New commits: commit 40fdfea0ae994569fb0919c974fc2356dd4bb5c4 Author: Jens Carl <[email protected]> Date: Tue Aug 22 06:27:18 2017 +0000 tdf#45904 Remove/disable obsolete _XSpreadsheetDocument Java test The _XSpreadsheetDocument test is already written in C++ since commit b9337e22ce1dbf2eba0e8c8db294ae99f4111f91. Change-Id: Icc0fc266f6e375ceb94edd5a95d396540972a908 Reviewed-on: https://gerrit.libreoffice.org/41409 Tested-by: Jenkins <[email protected]> Reviewed-by: Markus Mohrhard <[email protected]> diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 0360b4f288eb..92b9912342f5 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -635,7 +635,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_XSheetOperation \ qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak \ qadevOOo/tests/java/ifc/sheet/_XSpreadsheet \ - qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument \ qadevOOo/tests/java/ifc/sheet/_XSpreadsheetView \ qadevOOo/tests/java/ifc/sheet/_XSubTotalCalculatable \ qadevOOo/tests/java/ifc/sheet/_XSubTotalDescriptor \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv index 97c52331d984..b77e34c1984a 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv @@ -14,7 +14,6 @@ "ScModelObj";"com::sun::star::lang::XComponent";"dispose()" "ScModelObj";"com::sun::star::lang::XComponent";"addEventListener()" "ScModelObj";"com::sun::star::lang::XComponent";"removeEventListener()" -"ScModelObj";"com::sun::star::sheet::XSpreadsheetDocument";"getSheets()" "ScModelObj";"com::sun::star::util::XProtectable";"protect()" "ScModelObj";"com::sun::star::util::XProtectable";"unprotect()" "ScModelObj";"com::sun::star::util::XProtectable";"isProtected()" diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java deleted file mode 100644 index bd8a598efea7..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument.java +++ /dev/null @@ -1,50 +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.sheet; - -import lib.MultiMethodTest; - -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.sheet.XSpreadsheets; - -/** -* Testing <code>com.sun.star.sheet.XSpreadsheetDocument</code> -* interface methods : -* <ul> -* <li><code> getSheets()</code></li> -* </ul> <p> -* @see com.sun.star.sheet.XSpreadsheetDocument -*/ -public class _XSpreadsheetDocument extends MultiMethodTest { - - public XSpreadsheetDocument oObj = null; - - /** - * Test calls the method and checks returned value. <p> - * Has <b> OK </b> status if returned value isn't null. <p> - */ - public void _getSheets() { - XSpreadsheets sheets = oObj.getSheets(); - tRes.tested("getSheets()", sheets != null); - } - - -} // finish class _XSpreadsheetDocument - - commit 494b7089b741c2944f72e2e4e9ea68aa500eb2d1 Author: Jens Carl <[email protected]> Date: Tue Aug 22 06:13:04 2017 +0000 tdf#45904 Remove/disable obsolete _XSheetOutline Java tests The _XSheetOutline tests are already written in C++ since commit b9337e22ce1dbf2eba0e8c8db294ae99f4111f91. Change-Id: I0803df8dec6fd2f18e89c7bd8b8d15d0e4ee4aa2 Reviewed-on: https://gerrit.libreoffice.org/41408 Tested-by: Jenkins <[email protected]> Reviewed-by: Markus Mohrhard <[email protected]> diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index a1ed436b45ff..0360b4f288eb 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -633,7 +633,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_XSheetFilterDescriptor \ qadevOOo/tests/java/ifc/sheet/_XSheetLinkable \ qadevOOo/tests/java/ifc/sheet/_XSheetOperation \ - qadevOOo/tests/java/ifc/sheet/_XSheetOutline \ qadevOOo/tests/java/ifc/sheet/_XSheetPageBreak \ qadevOOo/tests/java/ifc/sheet/_XSpreadsheet \ qadevOOo/tests/java/ifc/sheet/_XSpreadsheetDocument \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv index ce12322be8e2..2dbb627cf654 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv @@ -27,13 +27,6 @@ "ScTableSheetObj";"com::sun::star::util::XSearchable";"findAll()" "ScTableSheetObj";"com::sun::star::util::XSearchable";"findFirst()" "ScTableSheetObj";"com::sun::star::util::XSearchable";"findNext()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"group()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"ungroup()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"autoOutline()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"clearOutline()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"hideDetail()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"showDetail()" -"ScTableSheetObj";"com::sun::star::sheet::XSheetOutline";"showLevel()" "ScTableSheetObj";"com::sun::star::table::XColumnRowRange";"getColumns()" "ScTableSheetObj";"com::sun::star::table::XColumnRowRange";"getRows()" "ScTableSheetObj";"com::sun::star::sheet::XSheetFilterable";"createFilterDescriptor()" diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java b/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java deleted file mode 100644 index 7471ea4a6df4..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java +++ /dev/null @@ -1,137 +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.sheet; - -import com.sun.star.sheet.XCellRangesQuery; -import com.sun.star.sheet.XSheetCellRanges; -import lib.MultiMethodTest; - -import com.sun.star.sheet.XSheetOutline; -import com.sun.star.table.CellRangeAddress; -import com.sun.star.table.TableOrientation; -import com.sun.star.uno.UnoRuntime; -import lib.Status; -import lib.StatusException; - -/** - * - */ -public class _XSheetOutline extends MultiMethodTest { - public XSheetOutline oObj = null; - CellRangeAddress address = null; - CellRangeAddress subaddress = null; - - @Override - public void before() { - address = (CellRangeAddress)tEnv.getObjRelation("CellRangeAddress"); - subaddress = (CellRangeAddress)tEnv.getObjRelation("CellRangeSubAddress"); - if (address == null) - throw new StatusException(Status.failed("Object relation CellRangeAddress not found")); - if (subaddress == null) - throw new StatusException(Status.failed("Object relation CellRangeSubAddress not found")); - } - - public void _autoOutline() { - executeMethod("ungroup()"); - boolean result = false; - oObj.autoOutline(address); - // initially the range is grouped and shown - result = isCellShown(subaddress); - oObj.hideDetail(address); - // here only a part of the address is hidden: subaddress must be that part - result &= !isCellShown(subaddress); - tRes.tested("autoOutline()", result); - } - - public void _clearOutline() { - executeMethod("autoOutline()"); - boolean result = false; - oObj.clearOutline(); - result = isCellShown(subaddress); - oObj.hideDetail(address); - result &= isCellShown(subaddress); - tRes.tested("clearOutline()", result); - } - - public void _group() { - oObj.group(address, TableOrientation.COLUMNS); - oObj.group(address, TableOrientation.ROWS); - tRes.tested("group()", true); - } - - public void _ungroup() { - executeMethod("showDetail()"); - oObj.ungroup(address, TableOrientation.COLUMNS); - oObj.ungroup(address, TableOrientation.ROWS); - oObj.hideDetail(address); - tRes.tested("ungroup()", isCellShown(address)); - } - - public void _hideDetail() { - requiredMethod("group()"); - oObj.hideDetail(address); - tRes.tested("hideDetail()", !isCellShown(address)); - } - - public void _showDetail() { - executeMethod("showLevel()"); - oObj.showDetail(address); - tRes.tested("showDetail()", isCellShown(address)); - } - - public void _showLevel() { - executeMethod("hideDetail()"); - boolean result = false; - oObj.showLevel((short)2, TableOrientation.COLUMNS); - oObj.showLevel((short)2, TableOrientation.ROWS); - result = isCellShown(address); - oObj.showLevel((short)0, TableOrientation.COLUMNS); - oObj.showLevel((short)0, TableOrientation.ROWS); - - result &= !isCellShown(address); - tRes.tested("showLevel()", result); - } - - private boolean isCellShown(CellRangeAddress range) { - boolean isNotShown = true; - XCellRangesQuery xCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oObj); - if (xCellRangesQuery != null) { - XSheetCellRanges xRanges = xCellRangesQuery.queryVisibleCells(); - CellRangeAddress[] visibleRanges = xRanges.getRangeAddresses(); - for (int i=0; i<visibleRanges.length; i++) { - isNotShown &= dotIsOutsideRange(range.StartRow, range.StartColumn, visibleRanges[i]); - isNotShown &= dotIsOutsideRange(range.StartRow, range.EndColumn, visibleRanges[i]); - isNotShown &= dotIsOutsideRange(range.EndRow, range.StartColumn, visibleRanges[i]); - isNotShown &= dotIsOutsideRange(range.EndRow, range.EndColumn, visibleRanges[i]); - log.println(isNotShown?"\tisOutSide":"\tisInside"); - } - } - return !isNotShown; - } - - private boolean dotIsOutsideRange(int dotRow, int dotColumn, CellRangeAddress range) { - log.println("Checking dot(" + dotRow + "," + dotColumn + ") against row[" - + range.StartRow + ":" + range.EndRow + "] column[" - + range.StartColumn + ":" + range.EndColumn + "]"); - boolean isInside = true; - if (dotRow >= range.StartRow && dotRow <= range.EndRow) - if (dotColumn >= range.StartColumn && dotColumn <= range.EndColumn) - isInside = false; - return isInside; - } -} commit da25c627f71eede6256b629336bf3fe30d89ace5 Author: Jens Carl <[email protected]> Date: Sun Aug 20 06:42:33 2017 +0000 tdf#45905 Remove/disable obsolete _XNamedRanges Java tests The _XNamedRanges test are already written in C++ since commit b9337e22ce1dbf2eba0e8c8db294ae99f4111f91. Change-Id: I8610cc50ce23de7183efb5d9b6b436f1b9dceae1 Reviewed-on: https://gerrit.libreoffice.org/41349 Tested-by: Jenkins <[email protected]> Reviewed-by: Markus Mohrhard <[email protected]> diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 82ba7bbc8bf7..a1ed436b45ff 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -612,7 +612,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_XLabelRange \ qadevOOo/tests/java/ifc/sheet/_XLabelRanges \ qadevOOo/tests/java/ifc/sheet/_XMultipleOperation \ - qadevOOo/tests/java/ifc/sheet/_XNamedRanges \ qadevOOo/tests/java/ifc/sheet/_XRangeSelection \ qadevOOo/tests/java/ifc/sheet/_XRecentFunctions \ qadevOOo/tests/java/ifc/sheet/_XScenario \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv index f3e5cdbf502e..815f57b9b10e 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv @@ -5,8 +5,4 @@ "ScNamedRangesObj";"com::sun::star::container::XIndexAccess";"getByIndex()" "ScNamedRangesObj";"com::sun::star::container::XElementAccess";"getElementType()" "ScNamedRangesObj";"com::sun::star::container::XElementAccess";"hasElements()" -"ScNamedRangesObj";"com::sun::star::sheet::XNamedRanges";"addNewByName()" -"ScNamedRangesObj";"com::sun::star::sheet::XNamedRanges";"addNewFromTitles()" -"ScNamedRangesObj";"com::sun::star::sheet::XNamedRanges";"removeByName()" -"ScNamedRangesObj";"com::sun::star::sheet::XNamedRanges";"outputList()" "ScNamedRangesObj";"com::sun::star::container::XEnumerationAccess";"createEnumeration()" diff --git a/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java b/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java deleted file mode 100644 index 78c867d69d04..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java +++ /dev/null @@ -1,316 +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.sheet; - -import java.util.Random; -import java.util.StringTokenizer; - -import lib.MultiMethodTest; -import lib.Status; -import lib.StatusException; - -import com.sun.star.container.XIndexAccess; -import com.sun.star.sheet.Border; -import com.sun.star.sheet.NamedRangeFlag; -import com.sun.star.sheet.XCellRangeAddressable; -import com.sun.star.sheet.XCellRangeReferrer; -import com.sun.star.sheet.XNamedRanges; -import com.sun.star.sheet.XSpreadsheet; -import com.sun.star.table.CellAddress; -import com.sun.star.table.CellRangeAddress; -import com.sun.star.table.XCell; -import com.sun.star.table.XCellRange; -import com.sun.star.text.XTextRange; -import com.sun.star.uno.UnoRuntime; - -/** -* Testing <code>com.sun.star.sheet.XNamedRanges</code> -* interface methods : -* <ul> -* <li><code> addNewByName()</code></li> -* <li><code> addNewFromTitles()</code></li> -* <li><code> removeByName()</code></li> -* <li><code> outputList()</code></li> -* </ul> <p> -* This test needs the following object relations : -* <ul> -* <li> <code>'SHEET'</code> (of type <code>XSpreadsheet</code>): -* to have a spreadsheet </li> -* <ul> <p> -* @see com.sun.star.sheet.XNamedRanges -* @see com.sun.star.sheet.XSpreadsheet -*/ -public class _XNamedRanges extends MultiMethodTest { - - public XNamedRanges oObj = null; - String name = "_XNamedRanges"; - XSpreadsheet oSheet = null; - - /** - * Retrieves object relations. - * @throws StatusException If one of relations not found. - */ - @Override - protected void before() { - oSheet = (XSpreadsheet)tEnv.getObjRelation("SHEET"); - if (oSheet == null) throw new StatusException(Status.failed - ("Relation 'SHEET' not found")); - } - - /** - * Test creates and stores random content and random type, calls the method - * and checks that new range exists in collection using method - * <code>hasByName()</code>. <p> - * Has <b> OK </b> status if new range exists in collection - * and no exceptions were thrown. <p> - */ - public void _addNewByName() { - boolean bResult = true; - CellAddress aPosition = new CellAddress((short)0, 2, 2); - int nType = getRandomType(); - String sContent = getRandomContent("D3;A6:B9;=F12"); - name += sContent; - log.println("Adding new range with name=\"" + name + - "\", sContent = \"" + sContent + - "\", aPosition = (" + aPosition.Sheet + ", " - + aPosition.Column + ", " - + aPosition.Row + - "), Type = " + nType + "."); - - oObj.addNewByName(name, sContent, aPosition, nType); - - //inserted for a bug - CellAddress listOutputPosition = new CellAddress((short)0, 1, 1); - oObj.outputList(listOutputPosition); - String s = null; - String s1 = null; - try { - s = oSheet.getCellByPosition(1, 1).getFormula(); - s1 = oSheet.getCellByPosition(2, 1).getFormula(); - } catch(com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Can't get cell by position: " + e); - bResult = false; - } - log.println("Outputlist returns: " + s + " " + s1); - //end of insertion - - bResult &= oObj.hasByName(name); - - tRes.tested("addNewByName()", bResult); - } - - /** - * Test creates a table with left and top titles, creates new ranges from - * top titles and left titles, checks all new title ranges. <p> - * Has <b> OK </b> status if all required title ranges are present - * in collection, if each of them have valid size and position and - * no exceptions were thrown. <p> - */ - public void _addNewFromTitles() { - boolean bResult = true; - - // First, create a small table. - log.println("Creating a small table."); - try { - XCell cell = null; - XTextRange textrange = null; - - for (int i = 1; i < 4; i++) { - cell = oSheet.getCellByPosition(0, i); - textrange = UnoRuntime. - queryInterface(XTextRange.class, cell); - textrange.setString("Row" + i); - - cell = oSheet.getCellByPosition(i, 0); - textrange = UnoRuntime. - queryInterface(XTextRange.class, cell); - textrange.setString("Column" + i); - } - - for (int i = 1; i < 4; i++) - for (int j = 1; j < 4; j++) { - cell = oSheet.getCellByPosition(i, j); - textrange = UnoRuntime. - queryInterface(XTextRange.class, cell); - textrange.setString("Val" + ((j - 1) * 3 + i)); - } - log.println("Finished creating table."); - log.println("Creating new ranges from titles"); - - CellRangeAddress CRA = new CellRangeAddress((short)0, 0, 0, 3, 3); - Border border = Border.TOP; - oObj.addNewFromTitles(CRA, border); - for (int i = 1; i < 4; i++) { - bResult &= oObj.hasByName("Column" + i); - - Object range = oObj.getByName("Column" + i); - XCellRangeReferrer CRR = UnoRuntime. - queryInterface(XCellRangeReferrer.class,range); - - XCellRange CR = CRR.getReferredCells(); - XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); - - CellRangeAddress objCRA = xCRA.getRangeAddress(); - - bResult &= (objCRA.EndColumn == i && objCRA.StartColumn == i); - bResult &= objCRA.StartRow == 1; - bResult &= objCRA.EndRow == 3; - bResult &= objCRA.Sheet == 0; - } - - border = Border.LEFT; - oObj.addNewFromTitles(CRA, border); - for (int i = 1; i < 4; i++) { - bResult &= oObj.hasByName("Row" + i); - - Object range = oObj.getByName("Row" + i); - XCellRangeReferrer CRR = UnoRuntime. - queryInterface(XCellRangeReferrer.class,range); - - XCellRange CR = CRR.getReferredCells(); - XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); - - CellRangeAddress objCRA = xCRA.getRangeAddress(); - - bResult &= (objCRA.EndRow == i && objCRA.StartRow == i); - bResult &= objCRA.StartColumn == 1; - bResult &= objCRA.EndColumn == 3; - bResult &= objCRA.Sheet == 0; - } - - oObj.outputList(new CellAddress((short)0, 5, 5)); - - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - e.printStackTrace(log); - bResult = false; - } catch (com.sun.star.lang.WrappedTargetException e) { - e.printStackTrace(log); - bResult = false; - } catch (com.sun.star.container.NoSuchElementException e) { - e.printStackTrace(log); - bResult = false; - } - - tRes.tested("addNewFromTitles()", bResult); - } - - /** - * Test calls the method and checks existing of named ranges obtained - * by relation <code>'SHEET'</code>. <p> - * Has <b> OK </b> status if all output named ranges exist - * and no exceptions were thrown. <p> - */ - public void _outputList() { - boolean bResult = true; - CellAddress CA = new CellAddress((short)0, 0, 0); - - XIndexAccess IA = UnoRuntime. - queryInterface(XIndexAccess.class, oObj); - - int elementsCount = IA.getCount(); - - oObj.outputList(CA); - - try { - for (int i = 0; i < elementsCount; i++) { - XCell cell = oSheet.getCellByPosition(0, i); - XTextRange textrange = UnoRuntime.queryInterface(XTextRange.class, cell); - String str = textrange.getString(); - bResult &= oObj.hasByName(str); - } - } catch(com.sun.star.lang.IndexOutOfBoundsException e) { - e.printStackTrace(log); - bResult = false; - } - - tRes.tested("outputList()", bResult); - } - - /** - * Test calls the method for existing range, checks number of ranges in - * collection after method call, calls method for non-existent named range. - * <p>Has <b> OK </b> status if number of named ranges is less by one than - * before method call and exception was thrown during second call. <p> - * The following method tests are to be completed successfully before : - * <ul> - * <li> <code> addNewByName() </code> : to have name of existent - * named range </li> - * </ul> - */ - public void _removeByName() { - requiredMethod("addNewByName()"); - boolean bResult = true; - XIndexAccess IA = UnoRuntime. - queryInterface(XIndexAccess.class, oObj); - - int elementsCount = IA.getCount(); - - // Removing existent element - oObj.removeByName(name); - bResult = elementsCount == IA.getCount() + 1; - - try { - // Removing unexistent element. - oObj.removeByName(name); - log.println("Exception expected when removed unexistent element!"); - bResult = false; - } catch (com.sun.star.uno.RuntimeException e) { - log.println("Expected exception occurred while testing" + - "removeByName() when removed unexistent element."); - - } - - tRes.tested("removeByName()", bResult); - } - - /** - * Method make string of random content. - * @return string of random content - */ - String getRandomContent(String str) { - String gRS = "none"; - Random rnd = new Random(); - - StringTokenizer ST = new StringTokenizer(str, ";"); - int nr = rnd.nextInt(ST.countTokens()); - if (nr < 1) - nr++; - - for (int i=1; i < nr + 1; i++) - gRS = ST.nextToken(); - - return gRS; - } - - /** - * Returns random value of named range flag. - */ - int getRandomType(){ - int types[] = { 0, - NamedRangeFlag.COLUMN_HEADER, - NamedRangeFlag.FILTER_CRITERIA, - NamedRangeFlag.PRINT_AREA, - NamedRangeFlag.ROW_HEADER - }; - - Random rnd = new Random(); - return types[rnd.nextInt(5)]; - } -} - commit fcbabad4e760a9fda8bbb5069e5dc45ab390b78d Author: Jens Carl <[email protected]> Date: Sat Aug 12 07:18:26 2017 +0000 tdf#45904 Remove/disable obsolete _XDataPilotTable Java tests The _XDataPilotTable tests are already written in C++ since commit 95780ec73990f96dc16fc677c895d00fa1360008. Change-Id: I5785a2b8edbe3166c8f81348cb36c117a4b9b736 Reviewed-on: https://gerrit.libreoffice.org/41079 Tested-by: Jenkins <[email protected]> Reviewed-by: Markus Mohrhard <[email protected]> diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 0808ae1dc59b..82ba7bbc8bf7 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -601,7 +601,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_XConsolidationDescriptor \ qadevOOo/tests/java/ifc/sheet/_XDatabaseRanges \ qadevOOo/tests/java/ifc/sheet/_XDataPilotField \ - qadevOOo/tests/java/ifc/sheet/_XDataPilotTable \ qadevOOo/tests/java/ifc/sheet/_XDataPilotTables \ qadevOOo/tests/java/ifc/sheet/_XDataPilotTablesSupplier \ qadevOOo/tests/java/ifc/sheet/_XDDELink \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDataPilotTableObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDataPilotTableObj.csv index 25b3743c0e05..b946708afac7 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDataPilotTableObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDataPilotTableObj.csv @@ -1,4 +1,2 @@ "ScDataPilotTableObj";"com::sun::star::container::XNamed";"getName()" "ScDataPilotTableObj";"com::sun::star::container::XNamed";"setName()" -"ScDataPilotTableObj";"com::sun::star::sheet::XDataPilotTable";"getOutputRange()" -"ScDataPilotTableObj";"com::sun::star::sheet::XDataPilotTable";"refresh()" diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java deleted file mode 100644 index d6db10c87172..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable.java +++ /dev/null @@ -1,97 +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.sheet; - -import lib.MultiMethodTest; -import lib.Status; -import lib.StatusException; - -import com.sun.star.sheet.XDataPilotTable; -import com.sun.star.table.CellAddress; -import com.sun.star.table.CellRangeAddress; -import com.sun.star.table.XCell; - -/** -* Testing <code>com.sun.star.sheet.XDataPilotTable</code> -* interface methods : -* <ul> -* <li><code> getOutputRange()</code></li> -* <li><code> refresh()</code></li> -* </ul> <p> -* This test needs the following object relations : -* <ul> -* <li> <code>'OUTPUTRANGE'</code> (of type <code>CellAddress</code>): -* to check value returned by method <code>getOutputRange()</code> </li> -* <li> <code>'CELLFORCHANGE'</code> (of type <code>XCell</code>): -* to check the method refresh(value of this cell will be changed)</li> -* <li> <code>'CELLFORCHECK'</code> (of type <code>XCell</code>): -* to check the method refresh (value of this cell must be changed after refresh -* call) </li><ul> <p> -* @see com.sun.star.sheet.XDataPilotTable -* @see com.sun.star.table.CellAddress -*/ -public class _XDataPilotTable extends MultiMethodTest { - - public XDataPilotTable oObj = null; - XCell xCellForChange = null; - XCell xCellForCheck = null; - CellAddress OutputRange = null; - - @Override - protected void before() { - xCellForChange = (XCell)tEnv.getObjRelation("CELLFORCHANGE"); - xCellForCheck = (XCell)tEnv.getObjRelation("CELLFORCHECK"); - OutputRange = (CellAddress)tEnv.getObjRelation("OUTPUTRANGE"); - if (xCellForChange == null || OutputRange == null || - xCellForCheck == null) { - throw new StatusException(Status.failed("Relation not found")); - } - } - /** - * Test calls the method and checks returned value using value obtained by - * object relation <code>'OUTPUTRANGE'</code>. <p> - * Has <b> OK </b> status if values are equal. <p> - */ - public void _getOutputRange(){ - boolean bResult = true; - CellRangeAddress objRange = oObj.getOutputRange(); - bResult &= OutputRange.Sheet == objRange.Sheet; - bResult &= OutputRange.Row == objRange.StartRow; - bResult &= OutputRange.Column == objRange.StartColumn; - tRes.tested("getOutputRange()", bResult); - } - - /** - * Test sets new value of the cell obtained by object relation - * 'CELLFORCHANGE', and checks value of the cell obtained by object - * relation 'CELLFORCHECK'.<p> - * Has <b>OK</b> status if value of the cell obtained by object relation - * 'CELLFORCHECK' is changed. <p> - */ - public void _refresh(){ - xCellForChange.setValue(5); - double oldData = xCellForCheck.getValue(); - oObj.refresh(); - double newData = xCellForCheck.getValue(); - log.println("Old data:" + oldData + "; new data:" + newData); - - tRes.tested("refresh()", oldData != newData); - } -} - _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
