diff options
author | Jens Carl <j.carl43@gmx.de> | 2019-01-13 05:13:07 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2019-01-13 19:32:27 +0100 |
commit | 5c30493e95e54f082bd4b43d735a38c2339e1f92 (patch) | |
tree | 60fa12c7bcd4873fd7648e4fe3df274ae374fe7d /qadevOOo/tests/java/mod | |
parent | 9f77ab80d8aa8e696c8ede59cd00606bdaa2b6fe (diff) |
tdf#45904 Move XNameAccess Java tests to C++
Move XNameAccess Java tests to C++ for ScDatabaseRangesObj.
Change-Id: Id54f9bc1a9215a4524be4a1f52800049ce438c8a
Reviewed-on: https://gerrit.libreoffice.org/66250
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'qadevOOo/tests/java/mod')
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java deleted file mode 100644 index fd8900babcc1..000000000000 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java +++ /dev/null @@ -1,122 +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.beans.XPropertySet; -import com.sun.star.lang.XComponent; -import com.sun.star.sheet.XDatabaseRanges; -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.table.CellRangeAddress; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -/** -* Test for object which is represented by service -* <code>com.sun.star.sheet.DatabaseRanges</code>. <p> -* Object implements the following interfaces : -* <ul> -* <li> <code>com::sun::star::sheet::XDatabaseRanges</code></li> -* <li> <code>com::sun::star::container::XNameAccess</code></li> -* <li> <code>com::sun::star::container::XElementAccess</code></li> -* </ul> -* @see com.sun.star.sheet.DatabaseRanges -* @see com.sun.star.sheet.XDatabaseRanges -* @see com.sun.star.container.XNameAccess -* @see com.sun.star.container.XElementAccess -* @see ifc.sheet._XDatabaseRanges -* @see ifc.container._XNameAccess -* @see ifc.container._XElementAccess -*/ -public class ScDatabaseRangesObj extends TestCase { - private XSpreadsheetDocument xSheetDoc = null; - - /** - * Creates Spreadsheet document. - */ - @Override - protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { - SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() ); - log.println( "creating a Spreadsheet document" ); - 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 the collection of database ranges in the document. - * If the database range with name <code>'dbRange'</code> doesn't exist - * in the collection then creates new database range and adds it to the - * collection with the name <code>'dbRange'</code> to have one element - * for the test of the interface <code>ElementAccess</code> at least. - * The collection of database ranges is the instance of the service - * <code>com.sun.star.sheet.DatabaseRanges</code>. - * @see com.sun.star.sheet.DatabaseRanges - * @see com.sun.star.container.XElementAccess - */ - @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { - - XInterface oObj = null; - - // creation of testobject here - // first we write what we are intend to do to log file - log.println( "Creating a test environment" ); - - log.println("Getting test object ") ; - XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); - - XDatabaseRanges dbRanges = null; - dbRanges = (XDatabaseRanges) AnyConverter.toObject( - new Type(XDatabaseRanges.class), - docProps.getPropertyValue("DatabaseRanges")); - - log.println("Adding at least one element for ElementAccess interface"); - CellRangeAddress aRange = new CellRangeAddress((short)0, 2, 4, 5, 6); - if (!dbRanges.hasByName("dbRange")) { - dbRanges.addNewByName("dbRange", aRange); - } - - oObj = dbRanges; - TestEnvironment tEnv = new TestEnvironment( oObj ); - - // Other parameters required for interface tests - return tEnv; - } - -} - - |